public bool Join(Player player) { bool re = false; for (int i = 0; i < 8; i++) { if (Players[i] == null) { Players[i] = player; re = true; break; } } if (re) { player.JoinBattle(this); isFull = Players.Count(p => p != null) == 8; } return re; }
public Battle(Player player) : this(player.Udemae) { Players[0] = player; player.JoinBattle(this); }
public void SomeOneReset() { var reset = GB.Random.Next(ResetMin, ResetMax); var indexes = Enumerable.Range(0, PlayerCount).OrderBy(p => GB.Random.NextDouble()).Take(reset); foreach (var item in indexes) { Players[item] = new Player(PlayerStrengthFunc()); } }