Exemplo n.º 1
0
 public Zone(int row, int col)
 {
     selectedZone = null;
     zoneType = 1;
     zoneType = (int)ZoneStates.Water;
     positionRectangle = new Rectangle((40 * col) + 300, (30 * row) + 55, 40, 30); //+300 and +55 are positioning the whole map to the right and south
 }
Exemplo n.º 2
0
 public Zone(int row, int col)
 {
     selectedZone = null;
     zoneType = 1;
     zoneType = (int)ZoneStates.Water;
     positionRectangle = new Rectangle((40 * col) + 300, (30 * row) + 55, 40, 30); //+300 and +55 are positioning the whole map to the right and south
     this.id = idCounter;
     upgradeCost = 300;
     numberOfSouls = 0;
     idCounter++;
 }
Exemplo n.º 3
0
 public static void setSelectedZone(Zone zone)
 {
     selectedZone = zone;
 }
Exemplo n.º 4
0
        public override void Update(GameTime gameTime)
        {
            zoneSelected = Zone.GetSelectedZone();
            if (zoneSelected == null)
            {
                this.Visible = false;
                this.Enabled = true;
            }
            else
            {
                //Getting Zone Information
                idString = zoneSelected.getZoneIDString();
                typeString = zoneSelected.getZoneName(zoneSelected.GetZoneType()); //get zone type int.. give it to the GetZoneName and receive string with name of zone type
                upgradeCostString = zoneSelected.getUpgradeCost();

                this.Visible = true;
                this.Enabled = true;

                currentMouseState = Mouse.GetState();
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    CashSouls();
                }
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && upgradeRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {

                    Upgrade(Zone.GetSelectedZone());
                }
                pastMouseState = currentMouseState;
            }
            base.Update(gameTime);
        }
Exemplo n.º 5
0
 //To be implemented
 public void Upgrade(Zone zoneToUpgrade)
 {
     zoneToUpgrade.Upgrade();
 }
Exemplo n.º 6
0
        public static void returnSoul(Zone zone)
        {
            int numSouls = Convert.ToInt32(zone.getNumberOfSouls());
            int soulsOnHand = PointAndCurency.GetSouls();

            if (zone.GetZoneType() >= 2)
            {
                zone.setNumberOfSouls(numSouls + 1);
                PointAndCurency.SetSouls(soulsOnHand - 1);
            }

            /*foreach (var soul in souls)
            {
                if (soul.soulName == "currency")
                {
                    soul.soulName = "alive";
                    soul.age = 0;
                    soul.maxAge = random.Next(30, 140);
                    soul.goodLevel = soul.goodLevel - 2;

                }
            }*/
        }
Exemplo n.º 7
0
 //To be implemented
 public void Upgrade(Zone zoneToUpgrade)
 {
     zoneToUpgrade.Upgrade();
 }