Example #1
0
        private void SetWhiteChessMan()
        {
            foreach (Case kz in m_board.m_cases)
            {
                if (kz.m_center.Y <= 660)
                {
                    continue;
                }
                if (kz.m_center.Y == 900)
                {
                    break;
                }
                Pion pion = new Pion();
                pion.SetWindow(ref m_window);
                pion.SetTexture(ref m_whiteChess);
                pion.GetSprite.Position = kz.m_center;
                pion.Position           = kz.m_center;
                pion.Color      = Color.White;
                pion.Boundaries = new FloatRect(pion.Position.X - (kz.m_boundaries.Width / 2.0f), pion.Position.Y - (kz.m_boundaries.Height / 2.0f), kz.m_boundaries.Width, kz.m_boundaries.Height);
                pion.SetBoard(ref m_board);
                m_joueur1.Add(pion);
            }

            Tour tour1 = new Tour();

            tour1.SetWindow(ref m_window);
            tour1.SetTexture(ref m_whiteChess);
            tour1.GetSprite.Position = new Vector2f(60, 900);
            tour1.Position           = new Vector2f(60, 900);
            tour1.Color      = Color.White;
            tour1.Boundaries = new FloatRect(tour1.Position.X - (m_board.m_cases[0].m_boundaries.Width / 2.0f), tour1.Position.Y - (m_board.m_cases[0].m_boundaries.Height / 2.0f), m_board.m_cases[0].m_boundaries.Width, m_board.m_cases[0].m_boundaries.Height);
            tour1.SetBoard(ref m_board);
            m_joueur1.Add(tour1);

            Tour tour2 = new Tour();

            tour2.SetWindow(ref m_window);
            tour2.SetTexture(ref m_whiteChess);
            tour2.GetSprite.Position = new Vector2f(900, 900);
            tour2.Position           = new Vector2f(900, 900);
            tour2.Color      = Color.White;
            tour2.Boundaries = new FloatRect(tour2.Position.X - (m_board.m_cases[0].m_boundaries.Width / 2.0f), tour2.Position.Y - (m_board.m_cases[0].m_boundaries.Height / 2.0f), m_board.m_cases[0].m_boundaries.Width, m_board.m_cases[0].m_boundaries.Height);
            tour2.SetBoard(ref m_board);
            m_joueur1.Add(tour2);
        }
Example #2
0
 private void SetBlackChessMan()
 {
     foreach (Case kz in m_board.m_cases)
     {
         if (kz.m_center.Y == 60)
         {
             continue;
         }
         if (kz.m_center.Y > 180)
         {
             break;
         }
         Pion pion = new Pion();
         pion.SetWindow(ref m_window);
         pion.SetTexture(ref m_blackChess);
         pion.GetSprite.Position = kz.m_center;
         pion.Position           = kz.m_center;
         pion.Color      = Color.Black;
         pion.Boundaries = new FloatRect(pion.Position.X - (kz.m_boundaries.Width / 2.0f), pion.Position.Y - (kz.m_boundaries.Height / 2.0f), kz.m_boundaries.Width, kz.m_boundaries.Height);
         pion.SetBoard(ref m_board);
         m_joueur2.Add(pion);
     }
 }