Пример #1
0
    public NinjaDescription GetLastDescription(NinjaDescription current)
    {
        currentDescriptions.Remove(current);
        var newDescription = ninjaBank.GetPreviousDescription(current);

        while (currentDescriptions.Contains(newDescription))
        {
            newDescription = ninjaBank.GetPreviousDescription(newDescription);
        }
        currentDescriptions.Add(newDescription);
        return(newDescription);
    }
Пример #2
0
    public NinjaDescription GetPreviousDescription(NinjaDescription current)
    {
        var index = Array.IndexOf(ninjaDescriptions, current);

        return(index == 0 ? ninjaDescriptions[Count - 1] : ninjaDescriptions[index - 1]);
    }
Пример #3
0
    public NinjaDescription GetNextDescription(NinjaDescription current)
    {
        var index = Array.IndexOf(ninjaDescriptions, current);

        return(ninjaDescriptions[(index + 1) % Count]);
    }