GetNumValues() public method

public GetNumValues ( ) : int
return int
        internal InteractionObject(Project p, int i) : base(p, i)
        {
            try {
                objectData = p.GetData("interactionData", ID * 3);

                // If this points to more data, follow the pointer
                if (objectData.GetNumValues() == 1)
                {
                    string label = objectData.GetValue(0);
                    objectData = p.GetData(label);

                    int count = SubID;
                    while (count > 0 && (objectData.GetIntValue(1) & 0x80) == 0)
                    {
                        count--;
                        objectData = objectData.NextData;
                    }
                }

                b0 = (byte)objectData.GetIntValue(0);
                b1 = (byte)objectData.GetIntValue(1);
                b2 = (byte)objectData.GetIntValue(2);
            }
            catch (InvalidLookupException) {
                objectData = null;
            }
            catch (FormatException) {
                objectData = null;
            }
        }
Beispiel #2
0
        internal EnemyObject(Project p, int i) : base(p, i)
        {
            try {
                objectData = p.GetData("enemyData", ID * 4);

                _objectGfxHeaderIndex = (byte)objectData.GetIntValue(0);
                _collisionReactionSet = (byte)objectData.GetIntValue(1);

                byte lookupIndex; // TODO: use this
                byte b3;

                if (objectData.GetNumValues() == 4)
                {
                    lookupIndex = (byte)objectData.GetIntValue(2);
                    b3          = (byte)(objectData.GetIntValue(3));
                }
                else
                {
                    Data subidData = Project.GetData(objectData.GetValue(2));
                    int  count     = SubID;
                    while (count > 0 && (subidData.GetIntValue(0) & 0x80) == 0x80)
                    {
                        subidData = subidData.NextData;
                        subidData = subidData.NextData;
                        count--;
                    }
                    lookupIndex = (byte)subidData.GetIntValue(0);
                    b3          = (byte)(subidData.NextData.GetIntValue(0));
                }

                _tileIndexBase = (byte)((b3 & 0xf) * 2);
                _oamFlagsBase  = (byte)(b3 >> 4);
            }
            catch (InvalidLookupException e) {
                Console.WriteLine(e.ToString());
                objectData = null;
            }
            catch (FormatException e) {
                Console.WriteLine(e.ToString());
                objectData = null;
            }
        }