public bool InitGameObject(GameObjects gameObject, Position position) { if (position.Pos1 >= 0 && position.Pos2 >= 0 && position.Pos1 < WorldHeight && position.Pos2 < WorldWidth) { Cell wantedCell = Cells[position.Pos1, position.Pos2]; if (wantedCell.GameObject == null) { wantedCell.GameObject = gameObject; if (gameObject is Person person) { person.World = this; } return(true); } } return(false); }
public virtual void Interaction(GameObjects obj) { Console.WriteLine("\nInteraction: {0} => {1}", Name, obj.Name); }
public bool InitGameObject(GameObjects gameObject, int position1, int position2) { return(InitGameObject(gameObject, new Position(position1, position2))); }
public Cell(GameObjects gameObject) { GameObject = gameObject; }