public void Join(User user) { _Users.Add(user); _CheckPlayerCount(); }
public void setCreator(User newCreator) { if( newCreator != null ) owner = newCreator; }
public bool isOwner(User _user) { if( _user != null && _user == owner) return true; return false; }
public void PushUser(User user) { _GameRooms.FirstOrDefault(x=>x.Id == new Guid())?.Join(user); }
/* * * private void ifWaterDrinken() * { * * * if ((water.positionX < hero.positionX + hero.sizeX && water.positionX > hero.positionX && water.positionY>hero.positionY&& water.positionY<hero.positionY+hero.sizeY) || * (water.positionX < hero.positionX + hero.sizeX && water.positionX > hero.positionX && water.positionY+water.sizeY > hero.positionY && water.positionY+water.sizeY < hero.positionY + hero.sizeY) || * (water.positionX + water.sizeX < hero.positionX + hero.sizeX && water.positionX + water.sizeX > hero.positionX && water.positionY > hero.positionY && water.positionY < hero.positionY + hero.sizeY) || * (water.positionX + water.sizeX < hero.positionX + hero.sizeX && water.positionX + water.sizeX > hero.positionX && water.positionY+ water.sizeY > hero.positionY && water.positionY+water.sizeY < hero.positionY + hero.sizeY)) * { * Random rnd = new Random(); * * GameArea.Children.Remove(water.display); * * water.positionX = rnd.Next(1920 - water.sizeX); * water.positionY = rnd.Next(1080 - water.sizeY); * * Canvas.SetLeft(water.display,water.positionX); * Canvas.SetTop(water.display, water.positionY); * GameArea.Children.Add(water.display); * * } * } * private void drawWater() * { * Canvas.SetLeft(water.display, water.positionX); * Canvas.SetTop(water.display, water.positionY); * GameArea.Children.Add(water.display); * } * */ private void setUser(User user) { this.Title = user.username + " ------- " + user.point.ToString(); }