public void RefreshWorldInfo(int turn, WorldInfo world)
        {
            this.world = world;

            playerCount = 0;
            for (int i = 0; i < world.Players.Length; i++)
            {
                if (world.Players[i].InGame) playerCount++;
            }
            this.myInfo = world.Players.Where(player => player.Name == this.PlayerName).Single();
            this.myCities = world.Cities.Where(city => city.Owner == this.PlayerName).ToList();
            this.enemyCities = world.Cities.Where(city => city.Owner != this.PlayerName).ToList();
            this.myUnits = world.Units.Where(unit => unit.Owner == this.PlayerName).ToList();
            this.enemyUnits = world.Units.Where(unit => unit.Owner != this.PlayerName).ToList();
            termeltEgysegekSzama = 0;

            // Funky
            if (turn == 1)
            {
                mainForm.Text = "X+X+X Hacked by WheatleyScience +X+X+";
            }
            if (turn > 1)
            {
                string newHead = mainForm.Text;
                char tmpChar = newHead[36];
                newHead = newHead.Remove(37, (newHead.Length - 37));
                newHead = newHead.Insert(0, tmpChar.ToString());
                mainForm.Text = newHead;
            }
            // //Funky
        }
Example #2
0
 public WorldInfo()
 {
     Debug.LogError("[WORLD INFO] WorldInfo");
     instance = this;
 }
        public void RefreshWorldInfo(int turn, WorldInfo world)
        {
            this.turn = turn;
            this.world = world;

            for (int i = 0; i < world.Players.Length; i++)
            {
                if (world.Players[i].Name == PlayerName)
                    myInfo = world.Players[i];
            }

            myUnits = new List<UnitInfo>();
            enemyUnits = new List<UnitInfo>();
            for (int i = 0; i < world.Units.Length; i++)
            {
                if (world.Units[i].Owner == PlayerName)
                    myUnits.Add(world.Units[i]);
                else
                    enemyUnits.Add(world.Units[i]);
            }

            myCities = new List<CityInfo>();
            enemyCities = new List<CityInfo>();
            for (int i = 0; i < world.Cities.Length; i++)
            {
                if (world.Cities[i].Owner == PlayerName)
                    myCities.Add(world.Cities[i]);
                else
                    enemyCities.Add(world.Cities[i]);
            }
            // Funky
            if (turn == 1)
            {
                mainForm.Text = "X+X+X Hacked by WheatleyScience +X+X+";
            }
            if (turn > 1)
            {
                string newHead = mainForm.Text;
                char tmpChar = newHead[36];
                newHead = newHead.Remove(37, (newHead.Length - 37));
                newHead = newHead.Insert(0, tmpChar.ToString());
                mainForm.Text = newHead;
            }
            // //Funky
        }
        public void RefreshWorldInfo(int turn, WorldInfo world)
        {
            // update turn counter
            this.turn = turn;
            this.firstMove = true;

            // get my info
            for (int i = 0; i < world.Players.Length; i++)
            {
                if (world.Players[i].Name == PlayerName)
                    myPlayer = world.Players[i];
            }

            // get the cities list
            enemyCities = new List<CityInfo>();
            myCities = new List<CityInfo>();
            for (int i = 0; i < world.Cities.Length; i++)
            {
                if (world.Cities[i].Owner != PlayerName)
                    enemyCities.Add(world.Cities[i]);
                else
                    myCities.Add(world.Cities[i]);
            }
            citiesCount = myCities.Count;

            // get the list of my units
            myUnits = new List<UnitInfo>() ;
            for (int i = 0; i < world.Units.Length; i++)
            {
                if (world.Units[i].Owner == PlayerName)
                    myUnits.Add(world.Units[i]);
            }
        }
 public static string getWorldShortDesc(WorldInfo world)
 {
     if ((world.Supportculture == "ru") && (world.MapCulture == "ru"))
     {
         return world.ShortDesc.Replace("*", "").Replace("World", "Мир");
     }
     return world.ShortDesc.Replace("*", "");
 }
 public void btnWorldAction_Click(WorldInfo i)
 {
     if (i.Online)
     {
         this.serverAddr = i.HostExt;
         Program.WorldName = getWorldShortDesc(i);
         RemoteServices.Instance.ProfileWorldID = i.KingdomsWorldID;
         this.EnablePanels(false);
         this.JoinGameworld(new int?(i.Playing ? 1 : 0), new int?((this.PlayerGameworldCount > 0) ? 0 : 1), new int?(i.KingdomsWorldID), getWorldShortDesc(i));
     }
 }
 private void openInfoOverlay(WorldInfo info)
 {
     string text = ProfileLoginWindow.getWorldShortDesc(info);
     this.infoOverlay.Visible = true;
     if (InfoOverlayHeadings[info.KingdomsWorldID] == null)
     {
         Image image = WebStyleButtonImage.Generate(260, this.WebButtonheight + 4, text, this.WebTextFontBoldCond, ARGBColors.White, this.WebButtonRed, this.WebButtonRadius);
         InfoOverlayHeadings[info.KingdomsWorldID] = image;
     }
     this.infoOverlayHeading.Image = (Image) InfoOverlayHeadings[info.KingdomsWorldID];
     this.infoOverlayDurationValue.Text = "?";
     this.infoOverlayGameAgeValue.Text = "?";
     this.infoOverlayHousesValue.Text = "?";
     this.infoOverlayActivePlayersValue.Text = "?";
     if (InfoOverlayData[info.KingdomsWorldID] == null)
     {
         URLs.GameRPCAddress = info.HostExt;
         RemoteServices.Instance.init(URLs.GameRPC);
         RemoteServices.Instance.set_WorldInfo_UserCallBack(new RemoteServices.WorldInfo_UserCallBack(this.WorldInfoCallback));
         RemoteServices.Instance.WorldInfo();
     }
     else
     {
         this.infoOverlayFillinData((WorldInfoData) InfoOverlayData[info.KingdomsWorldID]);
     }
 }