コード例 #1
0
ファイル: Order.cs プロジェクト: ColleaguesME/CommandCenter
        public void Up()
        {
            bar.labelName.Content  = name + ' ' + quantity;
            bar.labelBegin.Content = Begin.ToString();
            bar.labelEnd.Content   = End.ToString();
            if (entity as Building != null)
            {
                timerBuild = End;
            }
            else if (entity as Unit != null)
            {
                timerRecruit = End;
            }
            double barracksSignificance = barracks.GetSignificance();

            entity.Up(quantity);
            if (entity as Barracks != null)
            {
                barracksToDateTime[barracks.Level] = End;
                if (barracksSignificance != barracks.GetSignificance())
                {
                    barracksInfos.Add(new PartialBarracksInfo(End, barracks.GetSignificance()));
                }
            }
            else if (entity as Farm != null)
            {
                farmInfos.Add(new PartialFarmInfo(timerBuild, farm.GetSignificance()));
            }
            else if (entity as Warehouse != null || entity as TimberCamp != null || entity as ClayPit != null || entity as IronMine != null)
            {
                waitInfos.Add(new PartialWaitInfo(timerResources, warehouse.GetSignificance(), Production));
            }
        }