public void EatFood(int id, Guid id_player, FoodPoint foodPoint) { var foodServer = FoodPoint.FoodPoints.FirstOrDefault(i => i.ID == id); FoodPoint.FoodPoints.Remove(foodServer); FoodPoint.FoodPoints.Add(foodPoint); var player = AllPlayers.players.FirstOrDefault(i => i.ID == id_player); player.Size++; player.Score++; foreach (PlayerServer playerServer in AllPlayers.players) { if (id_player != playerServer.ID) { playerServer.OperationContext.GetCallbackChannel <IClientCallback>().EnemyEatFood(foodPoint, id, id_player); } } }
public Service1() { FoodPoint.CreateFood(); }