Пример #1
0
        public Worker(PanoramaPage1 p, Grid dragonGrid, Grid dwarfsGrid, Grid boardGrid, Grid handGrid,Game g,Image library, Image playedCard)
        {
            page=p;
            this.dragonGrid = dragonGrid;
            this.dwarfsGrid = dwarfsGrid;
            this.boardGrid = boardGrid;
            this.handGrid = handGrid;
            this.libraryImage = library;
            this.playedCardImage = playedCard;
            Dwarf leader = new Dwarf(DwarfType.Leader, new Point(1, -2));
            Dwarf crossbowman = new Dwarf(DwarfType.Crossbowman, new Point(-2, 1));
            Dwarf webber = new Dwarf(DwarfType.Webber, new Point(1, 1));
            Dragon dragon = new Dragon(new Point(0, 0));
            figures = new List<Figure>();
            selectedFigure = null;
            figures.Add(leader);
            figures.Add(crossbowman);
            figures.Add(webber);
            figures.Add(dragon);
            game = g;
            game.Leader = leader;
            game.Webber = webber;
            game.Crossbowman = crossbowman;
            game.Dragon = dragon;
            game.ActionsLeft = 1;

            foreach (Figure f in figures)
            {
                Hex.GetHexByAxialCoordinates(game.Board.Hexs, f.Position).Figure = f;
            }
        }
Пример #2
0
Файл: Game.cs Проект: Zimex/Tess
        public Game(GameType type, Player p1, Player p2, Board b, Image lib, PanoramaPage1 p)
        {
            gameType = type;
            P1 = p1;
            P2 = p2;

            libraryImage = lib;
            board = b;
            if (p1.IsActiv == true)
                activPlayer = P1;
            else activPlayer = P2;
            page = p;
     
        }
Пример #3
0
        //public int b=1;
        public Dwarf(DwarfType t, Point p, PanoramaPage1 pag)
        {
            type = t;
            page = pag;
            Position = p;
            IsSelected = false;

            foreach (Image img in page.DwarfsGrid.Children)
            {
                if (img.Name == "crossbowmanCounter1")
                {
                    crossbowmanImageList.Add(img);
                }
                else
                    if (img.Name == "crossbowmanCounter2")
                    {
                        crossbowmanImageList.Add(img);
                    }
                    else
                        if (img.Name == "crossbowmanCounter3")
                        {
                            crossbowmanImageList.Add(img);
                        }
                        else
                            if (img.Name == "crossbowmanCounter4")
                            {
                                crossbowmanImageList.Add(img);
                            }
                            else
                                if (img.Name == "crossbowmanCounter5")
                                {
                                    crossbowmanImageList.Add(img);
                                }
                                else
                    if (img.Name == "webberCounter1")
                {
                    webberImageList.Add(img);
                }
                else
                        if (img.Name == "webberCounter2")
                        {
                            webberImageList.Add(img);
                        }
                        else
                            if (img.Name == "webberCounter3")
                            {
                                webberImageList.Add(img);
                            }
                            else
                                if (img.Name == "webberCounter4")
                                {
                                    webberImageList.Add(img);
                                }
                                else
                                if (img.Name == "leaderCounter1")
                                {
                                    leaderImageList.Add(img);
                                }
                                else
                                    if (img.Name == "leaderCounter2")
                                    {
                                        leaderImageList.Add(img);
                                    }
                                    else
                                        if (img.Name == "leaderCounter3")
                                        {
                                            leaderImageList.Add(img);
                                        }
                                        else
                                            if (img.Name == "leaderCounter4")
                                            {
                                                leaderImageList.Add(img);
                                            }
                                            else
                                                if (img.Name == "leaderCounter5")
                                                {
                                                    leaderImageList.Add(img);
                                                }
                                                else
                                                    if (img.Name == "leaderCounter6")
                                                    {
                                                        leaderImageList.Add(img);
                                
                                                    }
                                      
                                                   
            }

          

            switch(type)
            {
                case(DwarfType.Crossbowman):
                    hp = 5;
                    originalHp = 5;
                    dwarfImageList = crossbowmanImageList;
                    break;
                case(DwarfType.Leader):
                    hp = 6;
                    originalHp = 6;
                    dwarfImageList = leaderImageList;
                    break;
                case(DwarfType.Webber):
                    hp = 4;
                    originalHp = 4;
                    dwarfImageList = webberImageList;
                    break;
                default: break;

            }


        }