Primitive 0x0020 - Test Object Type


Use

There is a SimPe wizard for this instruction.

OperandDescriptionOperand Values
0 thru 3 GUID
4 & 5 Qualifiers on the variable in operand 6
6 Object to test
7 - bit 1 Checking original (not current) GUID Off: False
On: True
7 - bit 2 Return GUID selected in Temp 0,1 Off: False
On: True
7 - bit 3 Use NID for parent 2? Off: False
On: True
7 - bit 4 thru 8 Unused
8 thru 15 Unused

See Also


SimPe Code

// Decompiled with JetBrains decompiler
// Type: pjse.BhavNameWizards.WizPrim0x0020
// Assembly: pjse.coder.plugin, Version=4.0.3349.37576, Culture=neutral, PublicKeyToken=null

using pjse.BhavOperandWizards;
using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0020 : BhavWizPrim
  {
    public WizPrim0x0020(Instruction i)
      : base(i)
    {
    }

    public override ABhavOperandWiz Wizard() => (ABhavOperandWiz) new BhavOperandWiz0x0020(this.instruction);

    protected override string Operands(bool lng)
    {
      byte[] o = new byte[16];
      ((byte[]) this.instruction.Operands).CopyTo((Array) o, 0);
      ((byte[]) this.instruction.Reserved1).CopyTo((Array) o, 8);
      string str = "" + this.dataOwner(lng, o[6], o[4], o[5]) + ", " + Localization.GetString("bwp20_isInstanceOf") + ": " + BhavWiz.FormatGUID(lng, o, 0);
      if (lng)
        str = str + ", " + Localization.GetString("bwp20_originalGUID") + ": " + (((int) o[7] & 1) != 0).ToString() + ", " + Localization.GetString("bwp20_neighbourID") + ": " + (((int) o[7] & 2) != 0).ToString() + ", " + Localization.GetString("bwp20_returnTemp01") + ": " + (((int) o[7] & 4) != 0).ToString();
      return str;
    }
  }
}