コード例 #1
0
        // Read/write ROM
        private void ReadFromROM()
        {
            int pointerOffset = (AreaIndex * 2) + 0x148000;
            int offsetStart   = Bits.GetShort(rom, pointerOffset);
            int offsetEnd     = Bits.GetShort(rom, pointerOffset + 2);

            if (AreaIndex == 0x1FF)
            {
                offsetEnd = 0;
            }
            // no npc fields for area
            if (offsetStart >= offsetEnd)
            {
                return;
            }
            //
            int offset = offsetStart + 0x140000;

            this.Partition = rom[offset++];
            while (offset < offsetEnd + 0x140000)
            {
                var npcObject = new NPCObject();
                npcObject.ReadFromROM(NPCObjects, ref offset);
                NPCObjects.Add(npcObject);
            }
        }
コード例 #2
0
 // Inherited
 public override void Clear()
 {
     Layering.Clear();
     EventTriggers.Clear();
     ExitTriggers.Clear();
     NPCObjects.Clear();
     Overlaps.Clear();
     TileSwitches.Clear();
     CollisionSwitches.Clear();
 }
コード例 #3
0
 public void Insert(int index, NPCObject value)
 {
     if (index < NPCObjects.Count)
     {
         NPCObjects.Insert(index, value);
     }
     else
     {
         NPCObjects.Add(value);
     }
 }
コード例 #4
0
 public bool Remove(NPCObject value)
 {
     for (int i = 0; i < NPCObjects.Count; i++)
     {
         if (NPCObjects[i] == value)
         {
             NPCObjects.RemoveAt(i);
             return(true);
         }
     }
     return(false);
 }
コード例 #5
0
        public void Insert(int index, Point p)
        {
            var e = new NPCObject();

            e.X = (byte)p.X;
            e.Y = (byte)p.Y;
            if (index < NPCObjects.Count)
            {
                NPCObjects.Insert(index, e);
            }
            else
            {
                NPCObjects.Add(e);
            }
        }
コード例 #6
0
 public void Reverse(int index, int count)
 {
     NPCObjects.Reverse(index, count);
 }
コード例 #7
0
 public void RemoveAt(int index)
 {
     NPCObjects.RemoveAt(index);
 }
コード例 #8
0
 public void CopyTo(NPCObject[] triggers, int arrayIndex)
 {
     NPCObjects.CopyTo(triggers, arrayIndex);
 }
コード例 #9
0
 public void Clear()
 {
     NPCObjects.Clear();
 }