Ejemplo n.º 1
0
        public GraphCreator(ContentManager content)
        {
            VerticesNrBuilder = new StringBuilder("3");
            VerticesTextBox = new TextBox(content, "3", new Vector2(340, 200), new Vector2(450, 250), "liczba-kwiatkow", 0, "CzcionkaUI");
            VerticesButtons = new List<Button>(){
                new Button(new Vector2(350, 730), content, "anuluj"),
                new Button(new Vector2(650, 730), content, "start")};
            GCButtons = new List<Button>(){
                new Button(new Vector2(0, 730), content, "anuluj"),
                new Button(new Vector2(0, 660), content, "zapisz-graf"),
            };

            fenceTexture = content.Load<Texture2D>("Plotek");
        }
Ejemplo n.º 2
0
        public Game(GameType gT, GameMode gM, GardenGraph g, int c, ContentManager content, Player p1, Player p2, GameOrder go)
        {
            player2 = new Computer(true);
            colorBoxes = new List<ColorBox>();
            gameType = gT;
            gameMode = gM;
            graph = g;
            gameOrder = go;
            colors = ColorsCreator.GetColors(c);
            usedColors = new List<Color>();
            this.whoseTurn = 0;
            this.gardenerStartedMove = false;
            int distx = 55;
            int disty = 30;
            int offset = 10;

            colorsText = new TextBox(content, "", new Vector2(0, 0), new Vector2(0, 0), "KoloryText");

            for(int i =0;i<colors.Length;i++)
            {
                Vector2 vect = new Vector2(10+offset + (distx) * (i % 3), 30 +offset + (disty) * ((int)i / 3));
                colorBoxes.Add(new ColorBox(colors[i], content, vect));
            }

            player1 = p1;
            player2 = p2;
            panels = new List<TextBox>() { new TextBox(content, "",new Vector2(0,0),new Vector2(0,0),"Panel") };
            string ps1 = p1.isGardener ? "O: " : "S: ";
            string ps2 = p2.isGardener ? "O: " : "S: ";

            WhoseTurnText = new TextBox(content, "Tura: " + (p1.isGardener ? "Ogrodnika" : "Sasiada"), new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(250, 0)), Color.White, null, 0, "CzcionkaUI");
            Escape = new Button(Game1.GetRatioDimensions(new Vector2(1010, 740)), content, "wyjscie");

            if(p2 is Computer)
            {
                PlayersTexts = new TextBox[] { new TextBox(content, ps1 + p1.login, new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(10, 400)), Color.White, null, 0, "CzcionkaUI") };
                PlayerPoints = new TextBox[] { new TextBox(content, p1.points.ToString(), new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(30, 440)), Color.White, null, 0, "CzcionkaUI") };
            }
            else
            {
                PlayersTexts = new TextBox[] { new TextBox(content, ps1 + p1.login, new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(10, 400)), Color.White, null, 0, "CzcionkaUI"),
                                            new TextBox(content, ps2 + p2.login, new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(10, 600)), Color.White, null, 0, "CzcionkaUI"),};
                PlayerPoints = new TextBox[] { new TextBox(content, p1.points.ToString(), new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(30, 440)), Color.White, null, 0, "CzcionkaUI"),
                                           new TextBox(content, p2.points.ToString(), new Vector2(0, 0), Game1.GetRatioDimensions(new Vector2(30, 640)), Color.White, null, 0, "CzcionkaUI"),

                };
            }
        }
Ejemplo n.º 3
0
        public GraphCreator(ContentManager content)
        {
            int gameHeight = Game1.GetHeight();
            int gameWidth = Game1.GetWidth();

            VerticesNrBuilder = new StringBuilder("3");
            VerticesTextBox = new TextBox(content, "3", Game1.GetRatioDimensions(new Vector2(340, 200)), Game1.GetRatioDimensions(new Vector2(450, 250)), "liczba-kwiatkow", 0, "CzcionkaUI");
            VerticesButtons = new List<Button>(){
                new Button(Game1.GetRatioDimensions(new Vector2(350, 730)), content, "anuluj"),
                new Button(Game1.GetRatioDimensions(new Vector2(650, 730)), content, "start")};
            GCButtons = new List<Button>(){
                new Button(Game1.GetRatioDimensions(new Vector2(0, 730)), content, "anuluj"),
                new Button(Game1.GetRatioDimensions(new Vector2(0, 660)), content, "zapisz-graf"),
                new Button(Game1.GetRatioDimensions(new Vector2(0, 590)), content, "usun", Color.Gray),
                new Button(Game1.GetRatioDimensions(new Vector2(0, 520)), content, "dodaj-kwiatek")
            };

            fenceTexture = content.Load<Texture2D>("Plotek");
        }