示例#1
0
文件: Stage.cs 项目: Danil20-8/FlyOn
        public int this[BattleInfo info] {
            get
            {
                int result = 0;
                switch (source)
                {
                case ResourceValueSource.Const:
                    result = amount;
                    break;

                case ResourceValueSource.MyDeadShipsAmount:
                    result = info.GetDeadShipsAmount(info.teams.First(t => t.myTeam));
                    break;

                case ResourceValueSource.EnemyDeadShipsAmount:
                    result = info.GetDeadShipsAmount(info.teams.First(t => !t.myTeam));
                    break;
                }
                return(positive ? result : -result);
            }
        }