public void AddCuskEntity(ICuskEntity cuskEntity) { try { var result = cuskObjectDatabase.AddToDatabase(cuskEntity); } catch (Exception ex) { //Do something } }
public bool AddToDatabase(ICuskEntity cuskEntity) { if (CuskEntities.Contains(cuskEntity)) { return(false); } else { CuskEntities.Add(cuskEntity); return(true); } }
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); }