00001 /* 00002 CS Senior Project 2003 00003 Team : Leftfield 00004 Project : ModernWarfare 00005 Members : 00006 - Russ Christensen <rchriste@cs.utah.edu> 00007 - Todd Smith <tcsmith@cs.utah.edu> 00008 - Usit Duongsaa <duongsaa@cs.utah.edu> 00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 00012 00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 */ 00017 00022 #pragma once 00023 00024 #include "..\AEngine\AEngine.h" 00025 #include "MilitaryUnit.h" 00026 #include "Globals.h" 00027 #include "Player.h" 00028 #include "Bank.h" 00029 #include "Defs.h" 00030 #include "UniqueID.h" 00031 00032 #include <deque> 00033 00034 00035 class City 00036 : public DrawableObject, public UniqueID 00037 { 00038 public: 00039 City(const Vec3D & location, Player* owner=0 ); 00040 virtual ~City(void); 00041 virtual void draw(void) const; 00043 void drawSelectBox() const; 00045 void update(void); 00047 bool contains(Vec2D that) const; 00049 Vec3D position(void) const; 00051 Player* owner(void) const; 00053 Vec3D color(void) const; 00055 void changeOwner(Player* newOwner, bool taunting = false); 00057 bool collision(const MilitaryUnit* unit) const; 00059 void setRallyPoint(Vec3D rallyPoint); 00061 Vec3D& rallyPoint(); 00063 void trainUnit(int type); 00065 const deque<int>& trainees() const; 00067 int trainingTimeLeft() const; 00068 00070 int timeUntilFinishEconUpgrade(); 00071 int econLevel(); 00072 00074 void upgradeEcon(); 00075 00076 // add, subtract, and find out how many jets guard a city 00077 void addJetGaurd(); 00078 void deleteJetGuard(); 00080 int jetGaurdSize(); 00081 00082 private: 00084 void startEconUpgrade( int secToComplete ); 00085 00086 Vec3D m_size; 00087 Vec3D m_position; 00088 Player* m_pOwner; 00089 Vec3D m_color; 00090 Vec3D m_rallyPoint; 00091 deque<int> m_trainees; 00092 int m_timer; 00093 int m_currUnitType; 00094 DWORD m_timeOfLastDeposit; 00095 int m_econLevel; // economic level of the city. Level 1 produces little income, 9 produces most. 00096 int m_econRemainingTime; // when you tell a city to upgrade econ, we set this countdown timer 00097 // when it hits zero, the city econ levels up 00098 // default value is -1 when no upgrading is happening 00099 int m_jetGaurdSize; // number of jets guarding the city 00100 };
1.3-rc2