// 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); } }
// Inherited public override void Clear() { Layering.Clear(); EventTriggers.Clear(); ExitTriggers.Clear(); NPCObjects.Clear(); Overlaps.Clear(); TileSwitches.Clear(); CollisionSwitches.Clear(); }
public void Insert(int index, NPCObject value) { if (index < NPCObjects.Count) { NPCObjects.Insert(index, value); } else { NPCObjects.Add(value); } }
public bool Remove(NPCObject value) { for (int i = 0; i < NPCObjects.Count; i++) { if (NPCObjects[i] == value) { NPCObjects.RemoveAt(i); return(true); } } return(false); }
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); } }
public void Reverse(int index, int count) { NPCObjects.Reverse(index, count); }
public void RemoveAt(int index) { NPCObjects.RemoveAt(index); }
public void CopyTo(NPCObject[] triggers, int arrayIndex) { NPCObjects.CopyTo(triggers, arrayIndex); }
public void Clear() { NPCObjects.Clear(); }