public void AddItem(int x, int y, ItemObject itemObject) { GameLog.DebugFormat("{0}, {1}, {2} qty {3} id {4}", x, y, itemObject.Name, itemObject.Count, itemObject.Id); if (itemObject.Id == 0) { World.Insert(itemObject); } if (itemObject == null) { GameLog.DebugFormat("ItemObject is null, aborting"); return; } // Add the ItemObject to the world at the given location. itemObject.X = (byte)x; itemObject.Y = (byte)y; itemObject.Map = this; lock (_lock) { EntityTree.Add(itemObject); Objects.Add(itemObject); } NotifyNearbyAoiEntry(itemObject); }
public void InsertSignpost(Objects.Signpost post) { World.Insert(post); Insert(post, post.X, post.Y); Signposts[new Tuple <byte, byte>(post.X, post.Y)] = post; Logger.InfoFormat("Inserted signpost {0}@{1},{2}", post.Map.Name, post.X, post.Y); }
private void InsertDoor(byte x, byte y, bool open, bool isLeftRight, bool triggerCollision = true) { var door = new Objects.Door(x, y, open, isLeftRight, triggerCollision); World.Insert(door); Insert(door, door.X, door.Y); Doors[new Tuple <byte, byte>(door.X, door.Y)] = door; }
public void InsertReactor(reactor toinsert) { var reactor = new Reactor(toinsert); World.Insert(reactor); Insert(reactor, reactor.X, reactor.Y); reactor.OnSpawn(); }
public void InsertNpc(npc toinsert) { var merchant = new Merchant(toinsert); World.Insert(merchant); Insert(merchant, merchant.X, merchant.Y); merchant.OnSpawn(); }
public void InsertSignpost(signpost toinsert) { Logger.InfoFormat("Inserting signpost {0}@{1},{2}", toinsert.map.name, toinsert.map_x, toinsert.map_y); var post = new Signpost(toinsert); World.Insert(post); Insert(post, post.X, post.Y); Signposts[new Tuple <byte, byte>(post.X, post.Y)] = post; }
public void InsertNpc(Merchant toInsert) { World.Insert(toInsert); Insert(toInsert, toInsert.X, toInsert.Y); try { toInsert.OnSpawn(); } catch (Exception e) { GameLog.Error("NPC {name}: exception occurred, aborting: {e}", toInsert.Name, e); } }
public void InsertCreature(Creature toInsert) { World.Insert(toInsert); Insert(toInsert, toInsert.X, toInsert.Y); Logger.DebugFormat("Monster {0} with id {1} spawned.", toInsert.Name, toInsert.Id); }
public void InsertNpc(Merchant toInsert) { World.Insert(toInsert); Insert(toInsert, toInsert.X, toInsert.Y); toInsert.OnSpawn(); }
public void InsertReactor(Reactor toInsert) { World.Insert(toInsert); Insert(toInsert, toInsert.X, toInsert.Y); Reactors[new Tuple <byte, byte>(toInsert.X, toInsert.Y)] = toInsert; }