Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public virtual void Interaction(GameObjects obj)
 {
     Console.WriteLine("\nInteraction: {0} => {1}", Name, obj.Name);
 }
Exemplo n.º 3
0
 public bool InitGameObject(GameObjects gameObject, int position1, int position2)
 {
     return(InitGameObject(gameObject, new Position(position1, position2)));
 }
Exemplo n.º 4
0
 public Cell(GameObjects gameObject)
 {
     GameObject = gameObject;
 }