示例#1
0
 public void removeEntity(ChexelEntity toRemove)
 {
     if (entities.ContainsKey(toRemove.pos))
     {
         entities.Remove(toRemove.pos);
         toRemove.stop();
     }
 }
示例#2
0
 public bool moveEntity(ChexelEntity toMove, vector2 newPos)
 {
     if (checkCollide(toMove.pos, newPos))
     {
         return(false);
     }
     else
     {
         removeEntity(toMove);
         toMove.pos = newPos;
         return(addEntity(toMove));
     }
 }
示例#3
0
 public bool addEntity(ChexelEntity toAdd)
 {
     if (entities.ContainsKey(toAdd.pos))
     {
         return(false);
     }
     else
     {
         entities.Add(toAdd.pos, toAdd);
         if (isStarted)
         {
             toAdd.start();
         }
         return(true);
     }
 }