public void insertNPC(NPC npc, int y, int x, int height, int width) { fillRectangle(true, y, x, height, width); for (int i = y; i < height + y; i++) { for (int j = x; j < width + x; j++) { insertNPCAtLocation(npc, i, j); } } }
private void fillLevel1TrafficMap() { NPC testNPC = new NPC(this, new Point(300, 1200), 0); // need to move creation of NPCS somewhere else NPC testNPC2 = new NPC(this, new Point(350, 1200), 0); NPC testNPC3 = new NPC(this, new Point(750, 750), 0); testNPC.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/StationaryImage.png")); testNPC2.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/LargeStationaryImage.png")); testNPC3.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/LargeTallStationaryImage.png")); level1TrafficMap.insertNPC(testNPC, 1200, 300, 30, 30); //use npc height and width etc. level1TrafficMap.insertNPC(testNPC2, 1200, 350, 30, 30); level1TrafficMap.insertNPC(testNPC3, 750, 750, 30, 60); npcList.Add(testNPC); npcList.Add(testNPC2); npcList.Add(testNPC3); }
public void removeNPCfromList(NPC npc) { npcList.Remove(npc); }
public void addNPCtoList(NPC npc) { npcList.Add(npc); }
public void insertNPCAtLocation(NPC npc, int y, int x) { npcMap[y, x] = npc; }