Player.h

Go to the documentation of this file.
00001 /* -*- Mode: CC; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 5 -*- */
00002 
00003 /*
00004  * Combination of a first person action and a real time strategy battle game.
00005  */
00006  
00007 /*
00008  * Player.h
00009  * MetalWarriors
00010  * $Revision: 1.18 $
00011  *
00012  * Created by Daniel Aarno on Sun Nov 16 2003.
00013  * Copyright (c) 2003 Daniel Aarno and Erik Ytterberg - All rights reserved.
00014  *
00015  *     This program is free software; you can redistribute it and/or modify
00016  *     it under the terms of the GNU General Public License as published by
00017  *     the Free Software Foundation; either version 2 of the License, or
00018  *     (at your option) any later version.
00019  *
00020  *     This program is distributed in the hope that it will be useful,
00021  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *     GNU General Public License for more details.
00024  *
00025  *     You should have received a copy of the GNU General Public License
00026  *     along with this program; if not, write to the Free Software
00027  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00028  */
00029 
00030 #ifndef _PLAYER_
00031 #define _PLAYER_
00032 
00033 #include "VehicleSprite.h"
00034 #include "TankGroup.h"
00035 #include "Map.h"
00036 #include "Mission.h"
00037 #include <vector>
00038 #include "WinCond.h"
00039 
00040 typedef enum {
00041      TEAM_ID_START = 1000,
00042      TEAM_RED,
00043      TEAM_BLUE,
00044      TEAM_YELLOW,
00045      TEAM_BLACK,
00046      TEAM_WHITE
00047 } TeamColor;
00048 
00049 class Player
00050 {
00051  public:
00052      int base;  
00053      std::vector<VehicleSprite*> vehicles;
00054      VehicleSprite *currentVehicle;
00055      std::vector<VehicleGroup*> platoons;
00056      
00057  protected:
00058      int myId;
00059      Map *terrain_map;
00060      int rotate_camera;
00061      Cond wincond;
00062      
00063  public:
00064      Player(int plyId, class MissionDef *mission);
00065      
00066      VehicleSprite* getVehicleSprite() { return currentVehicle; }
00067      void doKey(int key, int x, int y, 
00068           bool special, bool down, unsigned int modifiers);
00069      void setCurrentVehicle(int index);
00070      void setCurrentPlatoon(int index);
00071      void endTurn();
00072      void update(void);
00073      void paint(void);
00074      void addVehicle(VehicleSprite *v);
00075      Cond& getWinCond() { return wincond; }
00076 
00077      void setId(int plyId);
00078      int getId();
00079      
00080  protected:
00081      int keyToGroup(int key);
00082 };
00083 
00084 #endif //_PLAYER_

Generated on Sun Mar 11 15:33:23 2007 for MetalWarriors by  doxygen 1.4.7