Exemplo n.º 1
0
 public void AddCuskEntity(ICuskEntity cuskEntity)
 {
     try
     {
         var result = cuskObjectDatabase.AddToDatabase(cuskEntity);
     }
     catch (Exception ex)
     {
         //Do something
     }
 }
Exemplo n.º 2
0
 public bool AddToDatabase(ICuskEntity cuskEntity)
 {
     if (CuskEntities.Contains(cuskEntity))
     {
         return(false);
     }
     else
     {
         CuskEntities.Add(cuskEntity);
         return(true);
     }
 }
Exemplo n.º 3
0
        public bool EntityCanMoveTo(int NewX, int NewY, ICuskEntity CuskEntity)
        {
            //Source and destination are the same
            if (NewX == CuskEntity.CurrentX && NewY == CuskEntity.CurrentY)
            {
                return(false);
            }
            //Another entity is on this space
            if (cuskObjectDatabase.IsEntityAtLoc(NewX, NewY))
            {
                return(false);
            }

            return(true);
        }