Exemplo n.º 1
0
 public void Write()
 {
     Console.ForegroundColor = Focused ? ConsoleColor.Green : ConsoleColor.White;
     Console.Write(
         " *********************** \n" +
         "* " + Name + "\t\t* \n" +
         "*\t" + "Price\t " + Price.ToString() + "\t*\n" +
         "*\tIncome\t " + Income.ToString() + "\t*\n" +
         "*\tAmount\t " + Amount + "\t*\n" +
         " *********************** \n\n");
     Console.ForegroundColor = ConsoleColor.White;
 }
Exemplo n.º 2
0
    void Update()
    {
        TextCosts.text  = Costs.ToString();
        TextIncome.text = "+" + Income.ToString();
        this.GetComponent <Button> ().interactable = gameControl.Gold >= Costs;

        if (timerMaxSpawn <= 0)
        {
            if (timerMaxSpawnInterval <= 0)
            {
                timerMaxSpawnInterval = TimeMaxSpawnInterval;
                SpawnUnit();
            }
            timerMaxSpawnInterval -= Time.deltaTime;
        }
        if (pointerDown)
        {
            timerMaxSpawn -= Time.deltaTime;
        }
    }
Exemplo n.º 3
0
        void DrawInterface(Point sel_pos)
        {
            foreach (var item in _interface.Dictionaryof_CityScreenButtons)
            {
                if (item.Value.Type == Listof_ButtonType.Panel)
                {
                    spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], item.Value.Location, item.Value.color);
                }
                if (item.Value.Type == Listof_ButtonType.Button)
                {
                    spriteBatch.Draw(TileTexture[(int)Listof_Texture.Button1], item.Value.Location, item.Value.color);
                }
            }


            int buttonID = 0;

            foreach (var tech in _t.BuildingTech)
            {
                if (tech.Value.Category == BuildCategorySelected)
                {
                    if (buttonID >= BuildButtonScroll)
                    {
                        var item   = _interface.Dictionaryof_CityScreenButtons[(Listof_ViewInterfaceButtons)0 + buttonID - BuildButtonScroll];
                        var button = item.Location;
                        button.Inflate(-10, -10);
                        spriteBatch.Draw(TileTexture[(int)Listof_Texture.ButtonIcons], button, new Rectangle((int)tech.Value.BuildIcon * 64, 0, 64, 64), item.color);
                    }
                    buttonID++;
                }

                if (buttonID - BuildButtonScroll >= 4)
                {
                    break;
                }
            }



            //RCI
            Vector2 RCI = new Vector2(Screen_Size.X - 400, Screen_Size.Y - 200);

            spriteBatch.DrawString(basicfont, "R", RCI + new Vector2(0, 0), Color.Green);
            spriteBatch.DrawString(basicfont, "C", RCI + new Vector2(30, 0), Color.Blue);
            spriteBatch.DrawString(basicfont, "I", RCI + new Vector2(60, 0), Color.Orange);
            spriteBatch.DrawString(basicfont, "I+", RCI + new Vector2(90, 0), Color.Orange);

            spriteBatch.DrawString(basicfont, _city.ResidentialDemand.ToString(), RCI + new Vector2(0, 160), Color.Green);
            spriteBatch.DrawString(basicfont, _city.CommercialDemandWorker.ToString(), RCI + new Vector2(30, 160), Color.Blue);
            spriteBatch.DrawString(basicfont, _city.IndustrialDemandBasic.ToString(), RCI + new Vector2(60, 160), Color.Orange);
            spriteBatch.DrawString(basicfont, _city.IndustrialDemandIntermediate.ToString(), RCI + new Vector2(90, 160), Color.Orange);

            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X - 2, (int)RCI.Y + 30 - 2, 28, 104), Color.SteelBlue);
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X, (int)RCI.Y + 30, 24, Convert.ToInt32(_city.ResidentialGrowth / 5)), Color.Silver);

            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 30 - 2, (int)RCI.Y + 30 - 2, 28, 104), Color.SteelBlue);
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 30, (int)RCI.Y + 30, 24, Convert.ToInt32(_city.CommercialDemandWorker / 5)), Color.Silver);

            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 60 - 2, (int)RCI.Y + 30 - 2, 28, 104), Color.SteelBlue);
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 60, (int)RCI.Y + 30, 24, Convert.ToInt32(_city.IndustrialDemandBasic / 5)), Color.Silver);

            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 90 - 2, (int)RCI.Y + 30 - 2, 28, 104), Color.SteelBlue);
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle((int)RCI.X + 90, (int)RCI.Y + 30, 24, Convert.ToInt32(_city.IndustrialDemandIntermediate / 5)), Color.Silver);

            //Day Timer
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle(18, Screen_Size.Y - 162, 104, 24), Color.SteelBlue);
            spriteBatch.Draw(TileTexture[(int)Listof_Texture.Panel1], new Rectangle(20, Screen_Size.Y - 160, Convert.ToInt32(DayCounter), 20), Color.Silver);

            spriteBatch.DrawString(basicfont, "Day " + Date.ToString(), new Vector2(20, Screen_Size.Y - 200), Color.White);


            spriteBatch.DrawString(basicfont, "+$" + Income.ToString(), new Vector2(Screen_Size.X - 200, Screen_Size.Y - 200), Color.LightGreen);
            spriteBatch.DrawString(basicfont, "$" + Currency.ToString(), new Vector2(Screen_Size.X - 200, Screen_Size.Y - 180), Color.White);

            if (BuildCost > 0)
            {
                spriteBatch.DrawString(basicfont, "-$" + BuildCost.ToString(), Mouse.GetState().Position.ToVector2() + new Vector2(20, -20), Color.White);
            }
            //spriteBatch.DrawString(basicfont, "-$" + BuildCost.ToString(), new Vector2(Screen_Size.X - 300, Screen_Size.Y - 180), Color.White);



            //DEBUG
            if (_city.CityArea.Contains(sel_pos))
            {
                spriteBatch.DrawString(basicfont, "Transfer Jobs: " + _city.TileMap[sel_pos.X, sel_pos.Y].Traffic.OriginJobsWorker.ToString(), new Vector2(0, 0), Color.White);
                spriteBatch.DrawString(basicfont, "Jobs: " + _city.TileMap[sel_pos.X, sel_pos.Y].Traffic.OriginJobsWorker.ToString(), new Vector2(0, 20), Color.White);
                spriteBatch.DrawString(basicfont, "Tier: " + _city.TileMap[sel_pos.X, sel_pos.Y].Traffic.tier.ToString(), new Vector2(0, 40), Color.White);

                spriteBatch.DrawString(basicfont, "Type: " + _e.Dictionaryof_BuildItems[_city.TileMap[sel_pos.X, sel_pos.Y].Type].BuildingType.ToString(), new Vector2(0, 60), Color.White);

                spriteBatch.DrawString(basicfont, "Connections: " + _city.TileMap[sel_pos.X, sel_pos.Y].ConnectedItems.ToString(), new Vector2(0, 80), Color.White);

                spriteBatch.DrawString(basicfont, "Tile: X=" + sel_pos.X.ToString() + " Y=" + sel_pos.Y.ToString(), new Vector2(0, 100), Color.White);

                spriteBatch.DrawString(basicfont, "Value: " + _city.TileMap[sel_pos.X, sel_pos.Y].LandValue.ToString(), new Vector2(0, 120), Color.White);
            }

            //spriteBatch.DrawString(basicfont, "SS: " + Screen_Scroll.ToString(), new Vector2(0, 140), Color.White);

            //spriteBatch.DrawString(basicfont, "CenterTile: " + CenterTile.ToString(), new Vector2(0, 160), Color.White);


            decimal unemp = 0;

            if (_city.WorkersSupply > 0)
            {
                unemp  = Math.Round(1 - (decimal)_city.WorkersDemand / (decimal)_city.WorkersSupply, 2);
                unemp *= 100;
            }

            if (_city.WorkersSupply == 0)
            {
                unemp = 0;
            }

            if (unemp > 0)
            {
                spriteBatch.DrawString(basicfont, "Unemployemnt %" + unemp.ToString(), new Vector2(0, 140), Color.White);
            }
            else
            {
                spriteBatch.DrawString(basicfont, "Available Jobs %" + Math.Abs(unemp).ToString(), new Vector2(0, 140), Color.White);
            }



            spriteBatch.DrawString(basicfont, "Worker Supply: " + _city.WorkersSupply.ToString(), new Vector2(300, 0), Color.White);
            spriteBatch.DrawString(basicfont, "Worker Demand: " + _city.WorkersDemand.ToString(), new Vector2(300, 20), Color.White);
            spriteBatch.DrawString(basicfont, "Worker Market: " + _city.WorkerMarket.ToString(), new Vector2(300, 40), Color.White);

            spriteBatch.DrawString(basicfont, "Commerce Supply: " + _city.CommerceSupply.ToString(), new Vector2(300, 60), Color.White);
            spriteBatch.DrawString(basicfont, "Commerce Demand: " + _city.CommerceDemand.ToString(), new Vector2(300, 80), Color.White);
            spriteBatch.DrawString(basicfont, "Commerce Market: " + _city.CommerceMarket.ToString(), new Vector2(300, 100), Color.White);

            spriteBatch.DrawString(basicfont, "Products Supply: " + _city.ProductsSupply.ToString(), new Vector2(300, 120), Color.White);
            spriteBatch.DrawString(basicfont, "Products Demand: " + _city.ProductsDemand.ToString(), new Vector2(300, 140), Color.White);
            spriteBatch.DrawString(basicfont, "Products Market: " + _city.ProductsMarket.ToString(), new Vector2(300, 160), Color.White);

            spriteBatch.DrawString(basicfont, "Excess Products: " + _city.ExcessProducts.ToString(), new Vector2(300, 180), Color.White);
            spriteBatch.DrawString(basicfont, "Excess Commerce: " + _city.ExcessCommerce.ToString(), new Vector2(300, 200), Color.White);


            spriteBatch.DrawString(basicfont, "Commpner Supply: " + _city.CommonerSupply.ToString(), new Vector2(600, 0), Color.White);


            foreach (var district in _city.districts)
            {
                spriteBatch.DrawString(basicfont, "PowerSupply: " + district.PowerSupply.ToString(), new Vector2(800, 20), Color.White);
                spriteBatch.DrawString(basicfont, "PowerDrain: " + district.PowerDrain.ToString(), new Vector2(800, 40), Color.White);

                spriteBatch.DrawString(basicfont, "Education: " + district.Education[0].ToString(), new Vector2(800, 60), Color.White);
                spriteBatch.DrawString(basicfont, "Education Growth: " + district.EducationGrowth[0].ToString(), new Vector2(800, 80), Color.White);

                spriteBatch.DrawString(basicfont, "WorkerGrowth: " + _city.ResidentialGrowth.ToString(), new Vector2(800, 100), Color.White);

                //spriteBatch.DrawString(basicfont, "Workers: " + district.Workers.ToString(), new Vector2(300, 0), Color.White);
                //spriteBatch.DrawString(basicfont, "Jobs: " + district.Jobs[0].ToString(), new Vector2(300, 20), Color.White);
                //spriteBatch.DrawString(basicfont, "JobMarket: " + district.JobMarket.ToString(), new Vector2(300, 40), Color.White);
                //spriteBatch.DrawString(basicfont, "Products: " + district.Products.ToString(), new Vector2(300, 60), Color.White);
                //spriteBatch.DrawString(basicfont, "Commerce: " + district.Commerce[0].ToString(), new Vector2(300, 80), Color.White);
            }
        }
Exemplo n.º 4
0
 public string Info()
 {
     return("Firma: " + Title + "\nOsoite: " + Address + "\nPuhelinnumero: " + Phone.ToString() + "\nTulot: "
            + Income.ToString() + "\nMenot: " + Expense.ToString());
 }