www.pudn.com > RCApp-src.zip > Data.h
/* RedEye Project (http://members.ozemail.com.au/~ndmcevoy/) Copyright (C) 2003 Nick McEvoy This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------- Commented for use with Doxygen (http://www.doxygen.org) ----------------------------------------------------------------- */ /*! \file Data.h * \brief Game data. * * This file contains game data. * * Note: These data structures and their contents will ultimately be * replaced by data files. For now things are a bit hard coded. :-( */ #ifndef _RE_GAME_DATA_H_ #define _RE_GAME_DATA_H_ // System includes #include// RedEye includes #include "Defs.h" // Platform model table static ModelData msPlatformModelData[] = { // Layout reminder: // {name,file,desc}, // Testing {TEST_CUBE, "Cube.ac", "Cube model for testing"}, {TEST_SPHERE, "Sphere.ac", "Sphere model for testing"}, // Land {BILLY_CART_BODY, "billy_cart_body-peng.ac", "Billy cart & penguin"}, {BILLY_CART_WHEEL, "billy_cart_wheel.ac", "Billy cart wheel"}, // todo // Water // todo // Air // todo // Space /*{SPACE_SHIP_TEST, "SpaceCraft.ac", "desc todo"}, {SPACE_SHIP_A, "STARHAWK.ac", "desc todo"}, {SPACE_STATION_A, "STATION2.ac", "desc todo"}, {SPACE_STATION_B, "spacest.ac", "desc todo"},*/ }; static int miNumPlatformModelItems = sizeof(msPlatformModelData)/sizeof(ModelData); // Weapon model table static ModelData msWeaponModelData[] = { // Layout reminder: // {name,file,desc}, // Testing {PLASMA_BOLT, "PlasmaBolt.ac", "desc todo"}, }; static int miNumWeaponModelItems = sizeof(msWeaponModelData)/sizeof(ModelData); // Platform model table static ModelData msResourceModelData[] = { // Layout reminder: // {name,file,desc}, // Testing {ASTEROID, "Asteroid.ac", "desc todo"}, }; static int miNumResourceModelItems = sizeof(msResourceModelData)/sizeof(ModelData); // Platform table static PlatformData msPlatformData[] = { // Layout reminder: // {name, model_name, desc, // cost, tech, hp, // crew, pasgr, cargo, weap, missle, // mass, fuel_cap, burn_rate, // max_fwd_thrust, max_rev_thrust, // max_head_thrust, max_pitch_thrust, max_roll_thrust, // power_fwd_factor, power_rev_factor, power_break_factor, power_damp_factor, // head_factor, head_damp_factor, pitch_factor, pitch_damp_factor, roll_factor, roll_damp_factor}, // Testing {PLAYER_TEST_SPHERE, TEST_SPHERE, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01}, {PLAYER_TEST_CUBE, TEST_CUBE, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000.0, 1000.0, 5.0, 5.0, 5.0, 0.5f, 0.5, 1.0, 0.5, 0.5f, 1.0, 0.5, 1.0, 0.5, 1.0}, {PLAYER_TEST_TUX_BILLY_KART, BILLY_CART_BODY, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100000.0, 100000.0, 10000.0, 10000.0, 10000.0, 0.5f, 0.5, 1.0, 1.0, 2.0f, 2.0, 2.0f, 2.0, 2.0f, 2.0}, {PLAYER_TEST_SPACE_SHIP_A, SPACE_SHIP_A, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100000.0, 50000.0, 5.0, 5.0, 5.0, 0.5f, 0.5, 1.0, 0.5, 0.5f, 1.0, 0.5, 1.0, 0.5, 1.0}, // Land // todo // Water // todo // Air // todo // Space {PLAYER_1, SPACE_SHIP_A, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100000.0, 50000.0, 5.0, 5.0, 5.0, 0.5f, 0.5, 1.0, 0.5, 0.5f, 1.0, 0.5, 1.0, 0.5, 1.0}, {SPACE_SHIP_A, SPACE_SHIP_A, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100000.0, 50000.0, 5.0, 5.0, 5.0, 0.1f, 0.1, 0.2, 0.1, 0.5f, 1.0, 0.5, 1.0, 0.5, 1.0}, {SPACE_STATION_A, SPACE_STATION_A, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0f, 0.0, 0.0, 0.0, 0.5f, 0.0, 0.5f, 0.0, 0.5f, 0.0}, {SPACE_STATION_B, SPACE_STATION_B, "desc todo", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0f, 0.0, 0.0, 0.0, 0.5f, 0.0, 0.5f, 0.0, 0.5f, 0.0}, }; static int miNumPlatformItems = sizeof(msPlatformData)/sizeof(PlatformData); // Weapon table static WeaponData msWeaponData[] = { // Layout reminder: // {name, model_name, desc, // cost, tech, hp, // Testing {PLASMA_BOLT, PLASMA_BOLT, "desc todo", 0, 0, 0}, }; static int miNumWeaponItems = sizeof(msWeaponData)/sizeof(WeaponData); /*// Building table static BuildingData msBuildingData[] = { }; static int miNumBuildingItems = sizeof(msBuildingData)/sizeof(BuildingData); // Scenery table static SceneryData msSceneryData[] = { }; static int miNumSceneryItems = sizeof(msSceneryData)/sizeof(SceneryData); // Equipment table static EquipmentData msEquipmentData[] = { }; static int miNumEquipmentItems = sizeof(msEquipmentData)/sizeof(EquipmentData);*/ // Resource table static ResourceData msResourceData[] = { // Layout reminder: // {name, model_name, desc, // cost, tech, hp, // Testing {ASTEROID, ASTEROID, "desc todo", 0, 0, 0}, }; static int miNumResourceItems = sizeof(msResourceData)/sizeof(ResourceData); PlatformData* GetPlatformProfileByName(const char* sName) { for (int i = 0; i < miNumPlatformItems; i++) { if (strcmp(msPlatformData[i].mEntityData.msName, sName) == 0) { return &msPlatformData[i]; } } return NULL; } WeaponData* GetWeaponProfileByName(const char* sName) { for (int i = 0; i < miNumWeaponItems; i++) { if (strcmp(msWeaponData[i].mEntityData.msName, sName) == 0) { return &msWeaponData[i]; } } return NULL; } ResourceData* GetResourceProfileByName(const char* sName) { for (int i = 0; i < miNumResourceItems; i++) { if (strcmp(msResourceData[i].mEntityData.msName, sName) == 0) { return &msResourceData[i]; } } return NULL; } #endif // _RE_GAME_DATA_H_