At first we should find out where are the odd brackets from
}}.
Then need to add property
_playerList because probably:
Цитата:
The name '_playerList' does not exist in the current context
|
And the code must be written in C# style as you work with it.
private IList<Account> accounts = new List<Account>();
/// <summary>
/// Account join to room
/// </summary>
/// <param name="account"></param>
public void Join(Account account)
{
// ...
accounts.Add(account);
// ...
}
/// <summary>
/// Get accounts by SlotState
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public IEnumerable<Account> GetAccounts(SlotState state)
{
return Accounts.Where(x => x.Slot.HasState(state));
}
/// <summary>
/// Ready battle request
/// </summary>
/// <param name="account"></param>
public void ReadyBattleRequest(Account account)
{
// ...
if (slot.HasState(SlotState.Normal))
{
account.SetState(SlotState.Ready);
}
else
{
account.SetState(SlotState.Normal);
}
// ...
}
Code: C#
And use:
var accounts = GetAccounts(SlotState.Ready);
Code: C#