コード例 #1
0
    public void Skip(int turns)
    {
        foreach (var invader in orderedList)
        {
            invader.Distance -= turns;
            if (invader.Distance <= 0)
            {
                this.Energy -= invader.Damage;
                if (this.Energy < 0)
                {
                    this.Energy = 0;
                }
                byAppearance.Remove(invader);
            }
        }

        orderedList.RemoveAll(x => x.Distance <= 0);
    }