Пример #1
0
 public Moves(Player _player, Nest _prevtnest, Jar _jar, Checker checker)
 {
     this.player = _player;
     this.jar = _jar;
     this.prevnest = _prevtnest;
     this.checker = checker;
 }
Пример #2
0
 public Moves(Player _player, Nest _prevtnest, Prison _prison, Checker checker)
 {
     this.player = _player;
     this.prison = _prison;
     this.prevnest = _prevtnest;
     this.checker = checker;
 }
Пример #3
0
        public void checkers_addTo_removeFrom_Home(Nest currentNest, Checker checker, List<Nest> nestList)
        {
            Boolean checkerInHomeArea = false;
            if (this.isOpponent == false)
            {
                if (currentNest.opponentNestID < 7)
                {
                    checkerInHomeArea = true;
                }
            }
            else
            {
                if (currentNest.paleyerNestID < 7)
                {
                    checkerInHomeArea = true;
                }
            }

            if (checkerInHomeArea)
            {
                if (!this.checkersInHome.Contains(checker))
                    this.checkersInHome.Add(checker);
            }
            else
            {
                if (this.checkersInHome.Contains(checker))
                    this.checkersInHome.Remove(checker);
            }
        }
Пример #4
0
 public Moves(Player _player, Nest _prevtnest, Nest _nextnest, Checker checker)
 {
     this.player = _player;
     this.nextnest = _nextnest;
     this.prevnest = _prevtnest;
     this.checker = checker;
 }
Пример #5
0
 public void addCheckersToPlayer()
 {
     for (int i = 1; i <= 15; i++)
     {
         Checker ch = new Checker(this.color + i, this.color);//
         this.checkers.Add(ch);
     }
 }
Пример #6
0
 public Boolean isInPrison(Checker checker)
 {
     Boolean isInPrison = false;
     foreach (Checker ch in this.checkers)
     {
         if(ch == checker){
             isInPrison = true;
             break;
         }
     }
     return isInPrison;
 }
Пример #7
0
 public int addChecker(Checker checker, Nest cameFromNest)
 {
     if (checker != null && cameFromNest != null)
     {
         cameFromNest.removeChecker(checker);
         this.checkers.Add(checker);
         int numCheckers = this.numberOfCheckers();
         int ch_Ypos = (int)this.center.Y + numCheckers*checker.width;
         checker.location = new Vector2(this.center.X, ch_Ypos);
     }
     return this.numberOfCheckers();
 }
Пример #8
0
        //SpriteBatch spriteBatch, Texture2D checkerTexture, String checkerID, String checkerColor, Color checkerTint
        public int addChecker(Checker checker)
        {
            int checker_newlocation_Y = 0;
            if (checker != null && this.checkers.Count < 15)
            {
                int checkerYlocationPlus = checker.width * this.checkers.Count;

                checker_newlocation_Y += checkerYlocationPlus;

                if (this.isUpper == false)
                {
                    //alumise jari alumine serv
                    checker_newlocation_Y = this.jar_y + this.height;
                    //y-koordinaat liigub ülesoole, kui lisatakse checker
                    checker_newlocation_Y -= checkerYlocationPlus;
                }
                Vector2 checkerLocation = new Vector2(this.jar_x + 10, checker_newlocation_Y);
                checker.location = checkerLocation;
                this.checkers.Add(checker);
            }
            return this.checkers.Count;
        }
Пример #9
0
 public int removeChecker(Checker checker)
 {
     this.Checkers.Remove(checker);
     return this.Checkers.Count;
 }
Пример #10
0
        //SpriteBatch spriteBatch, Texture2D checkerTexture, String checkerID, String checkerColor, Color checkerTint
        public int addChecker(Checker checker)
        {
            int checker_location_Y = 0;
            if(this.paleyerNestID < 13)
              checker_location_Y = this.y_location;
            else
              checker_location_Y = this.y_location+this.height-45;

            if (checker != null)
            {
                int checkerWidth = checker.width;
                int checkersInThisNest = this.Checkers.Count;
                int checkerYlocationPlus = checkerWidth * checkersInThisNest;

                if (this.paleyerNestID < 13)
                    checker_location_Y += checkerYlocationPlus;
                else
                {
                    checker_location_Y -= checkerYlocationPlus;
                }

                Vector2 checkerLocation = new Vector2(this.leftCorner+10, checker_location_Y);
                checker.location = checkerLocation;
                this.checkers.Add(checker);
            }
            return this.Checkers.Count;
        }
Пример #11
0
        private void moveCheckerIntoFreeNest(Nest clickedNest, Checker remCh, Player player, Nest nextNest)
        {
            if (player.checkers.Contains(remCh))
            {
                if(clickedNest != null)
                    clickedNest.Checkers.Remove(remCh);

                if (targetNestContainsMoreThanOneOpponentsChecker(nextNest, player))
                {
                    return;
                }
                else if (targetNestContainsNOopponentsChecker(nextNest, player))
                {
                    nextNest.addChecker(remCh);
                    if (clickedNest != null)
                        player.checkers_addTo_removeFrom_Home(clickedNest, remCh, gameBoard.Nests);
                }

            }
        }
Пример #12
0
 public int removeChecker(Checker checker)
 {
     this.checkers.Remove(checker);
     return(this.numberOfCheckers());
 }
Пример #13
0
 public int removeChecker(Checker checker)
 {
     this.checkers.Remove(checker);
     return this.numberOfCheckers();
 }