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 SHIP_H_
#define SHIP_H_
class Ship{
protected:
int length;
char id[15];
public:
virtual ~Ship()=0;
virtual int getLength()=0;
virtual bool getStatus()=0;
virtual char* getId()=0;
virtual void hit()=0;
virtual void reset()=0;
};
class Frigate:public Ship{
public:
Frigate();
virtual ~Frigate();
int getLength();
bool getStatus();
char* getId();
void hit();
void reset();
};
class Destroyer:public Ship{
public:
Destroyer();
virtual ~Destroyer();
int getLength();
bool getStatus();
char* getId();
void hit();
void reset();
};
class Cruiser:public Ship{
public:
Cruiser();
virtual ~Cruiser();
int getLength();
bool getStatus();
char* getId();
void hit();
void reset();
};
class Battleship:public Ship{
public:
Battleship();
virtual ~Battleship();
int getLength();
bool getStatus();
char* getId();
void hit();
void reset();
};
#endif/*SHIP_H_*/