Beispiel #1
0
 public TVillage()
 {
     Resource   = new TResource[4];
     InBuilding = new TInBuilding[6];
     Queue      = new List <IQueue>();
     Upgrades   = new Dictionary <int, TRU>();
     Market     = new TMarket();
     Troop      = new TTroop();
     for (int i = 1; i <= 10; i++)
     {
         Upgrades[i] = new TRU();
     }
     OasisInfo = new List <TOasisInfo>();
 }
        public void Display(TResource Res)
        {
            if(Res == null)
                return;
            label1.Text = string.Format("{0}/{1}", Res.CurrAmount, Res.Capacity);
            label3.Text = string.Format("({0:0}, {1}:{2:00}:{3:00})", Res.Produce,
                Math.Floor(Res.LeftTime.TotalHours),
                Res.LeftTime.Minutes, Res.LeftTime.Seconds);
            int color = Math.Abs(Convert.ToInt32(Res.LeftTime.TotalHours * 10));
            if(color > 255)
                color = 255;

            label3.ForeColor = Color.FromArgb(255 - color, 0, 0);
            label5.Text = string.Format("({0}, {1:F2}%)", Res.Capacity - Res.CurrAmount, Res.CurrAmount * 100.0 / Res.Capacity);
            color = Math.Abs(Res.CurrAmount * 255 / Res.Capacity);
            label5.ForeColor = Color.FromArgb(color, 0, 255 - color);
        }
Beispiel #3
0
 public TVillage()
 {
     Resource = new TResource[4];
     InBuilding = new TInBuilding[6];
     Queue = new List<IQueue>();
     Upgrades = new Dictionary<int, TRU>();
     Market = new TMarket();
     Troop = new TTroop();
     for (int i = 1; i <= 10; i++)
         Upgrades[i] = new TRU();
     OasisInfo = new List<TOasisInfo>();
 }