Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

player.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           player.h  -  description
00003                              -------------------
00004     begin                : Wed Jul 25 2001
00005     copyright            : (C) 2001 by T Kontkanen
00006     email                : tkontkanen@mail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef PLAYER_H
00019 #define PLAYER_H
00020 
00021 #include "allincludes.h"
00022 #include "gamedefs.h"
00023 
00028 class Unit;
00029 class UnitMarine;
00030 class UnitCommandCenter;
00031 class Player;
00032 class Game;
00033 class Ground;
00034 class Renderer;
00035 class Vector;
00036 
00037 enum AllianceModes { PLAYER_ALLY, PLAYER_ENEMY, PLAYER_NEUTRAL, PLAYER_SELF };
00038 
00039 class Player {
00040 public:
00041     
00042     Player( Game *pgame, int myplayernum );
00043     ~Player();
00044     
00045     void renderUnits();
00046     void unitAction( int actionnum, Vector destpos ); //execute action for selected units
00047     void primaryUnitAction( Vector destpos ); //execute primary action for selected units
00048     void unitStep(); //execute units's step() method
00049     void selectUnits( Vector &sel1, Vector &sel2 );
00050     enum AllianceModes getPlayerAllianceMode( int player ) { return alliancemodes[player]; }
00051     void setPlayerAllianceMode( int player, enum AllianceModes mode ) { alliancemodes[player]=mode; }
00052     
00053     Unit *units[MAX_UNITS];
00054     enum AllianceModes alliancemodes[MAX_PLAYERS];
00055 private:
00057     int findFreeUnit();
00058     int playerNum; // number of this player
00059     
00060     Renderer *renderer;
00061     Ground *ground;
00062     Game *game;
00063     
00064     friend Unit; friend UnitMarine; friend UnitCommandCenter;
00065 };
00066 
00067 #endif

Generated at Fri Oct 5 20:23:52 2001 for Executor by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001