public void UpdateUnit(Unit unit)
 {
     int X = GetLogicCoo(unit.position.X);
     int Y = GetLogicCoo(unit.position.Y);
     int oldX, oldY;
     ArrayList node = gameObjects[X, Y];
     unit.GetLogicCoo(out oldX, out oldY);
     gameObjects[oldX, oldY].Remove(unit);
     if (!node.Contains(unit))
     {
         node.Add(unit);
         unit.SetLogicCoo(X, Y);
     }
 }
 internal void RemoveUnit(Unit unit)
 {
     int X, Y;
     unit.GetLogicCoo(out X, out Y);
     gameObjects[X, Y].Remove(unit);
 }