Are you blogging on PH? Get your free blog.

View Battleship\inc\Screen.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 SCREEN_H_
#define SCREEN_H_

class Error;

class Screen{
private:
        int m_iMode;
       
        void clrscr();
        void clrlne(int iX,int iY);
        void gotoxy(int iX,int iY);
public:
        Screen();
        ~Screen();
        void printErrorMsg(const Error& refError);
        void clearErrorMsg();
        void displayHit(int iX,int iY);
        void displayMiss(int iX,int iY);
        void displayShip(int iX,int iY);
        int printMenu();
        void drawBoard();
        int printCredits(bool bYouLost,bool bComputerLost);
        void promptUserToHide(const char* pszType,int iLength);
        void promptUserToShoot();
        void printUserStatus(bool bHit,const char *pszType,bool bSunk);
        void printCompStatus(bool bHit,const char *pszType,bool bSunk);
        void getDirection(char& cRefDirection);
        void getUserCoordinate(char& cRefX,int& iRefY);
        void printUserSucessfullyPlaced();
        void printCompSucessfullyPlaced();
        void setMode(int iMode);
};

#endif/*SCREEN_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.