Stuck? Need help? Ask questions on our forums.

View Battleship\inc\Player.h

GPL'ed Battleship clone Win32/Linux 1.2.1

Submitted By: i_like_cpp
Rating: (Not rated) (Rate It)


/*
Free Battleship clone for Win32/Linux Console.
Copyright (C) 2005  Dennis Gertitschke

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef PLAYER_H_
#define PLAYER_H_

class Frigate;
class Destroyer;
class Cruiser;
class Battleship;
class Ship;
class Screen;

class Player{
        private:
        protected:
                bool m_bDefeat;
                int m_iShipCount;
                Frigate *m_pFrigate;
                Destroyer *m_pDestroyer;
                Cruiser *m_pCruiser;
                Battleship *m_pBattleship;
                Ship *m_arrBoard[100];
                Screen *m_pScreen;
                bool m_barrValidStart[100];
                bool m_barrValidShot[100];
                int m_iIndex;
               
                bool validateCoordinate(char cX,int iY);
                int transformToBoardIndex(char cX,int iY);
                                                                                                          
                void markNeighboursInvalid(char cStartX,int iStartY);
        public:
                Player();
                ~Player();
                bool returnStatus();
};

#endif /*PLAYER_H_*/
 
corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.