Esempio n. 1
0
 public int changeCommodityValue(Resource r, int change)
 {
     foreach (Commodity com in commodities)
     {
     if (com.Good.Name == r.Name)
     {
     //				System.Console.WriteLine("Changing " + r.Name + " by " + change + " ");
         com.TablePosition -= change;
         if (com.TablePosition >= marketTable.Length)
             com.TablePosition = marketTable.Length-1;
         if (com.TablePosition < 0)
             com.TablePosition = 0;
         return com.Value = marketTable[com.TablePosition];
     }
     }
     return 0;
 }
Esempio n. 2
0
 public void addResource(Resource a)
 {
     resources.Add(a);
 }
Esempio n. 3
0
        public void init()
        {
            /* Make Our Connection!*/
            Glade.XML gxml = new Glade.XML (SupportFileLoader.locateGameFile("gpremacy_gui/gpremacy_gui.glade"), "DeckDealerWindow", null);
            gxml.Autoconnect (this);
            cardsFlipped = 0;
            costPerCard = 200;
            targetResource = null;
            targetUnit = null;

            DeckDealerWindow.DeleteEvent += on_DeckDealer_delete_event;
            DeckDealerWindow.ExposeEvent += on_DeckDealer_exposed;

            DeckDealerOkay.Clicked += on_DeckDealerOkay_clicked;
            DeckDealerFlip.Clicked += on_DeckDealerFlip_clicked;
        }
Esempio n. 4
0
 public int getCommodityCost(Resource r)
 {
     foreach (Commodity com in commodities)
     {
     if (com.Good.Name == r.Name)
     {
         return com.Value;
     }
     }
     return 0;
 }
Esempio n. 5
0
 public Commodity(Resource i, int pos, int v)
 {
     good = i;
     tablePosition = pos;
     val = v;
 }
Esempio n. 6
0
 public void setCommodityCost(Resource r, int cost)
 {
     foreach (Commodity com in commodities)
     {
     if (com.Good.Name == r.Name)
     {
         com.Value = cost;
         return;
     }
     }
     return;
 }
Esempio n. 7
0
 public void initResource( Resource a, int slot )
 {
     commodities.Add( new Commodity(a, slot, marketTable[slot]) );
 }