Тема: [Point Blank] Help Ready Battle
Показать сообщение отдельно
Непрочитано 14.11.2016, 22:00   #3
Аватар для PROGRAMMATOR
Администратор

По умолчанию Re: Help Ready Battle

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#
__________________
composer require laravel/framework
yarn add vue
PROGRAMMATOR вне форума Отправить сообщение для PROGRAMMATOR с помощью ICQ Отправить сообщение для PROGRAMMATOR с помощью Skype™ Ответить с цитированием