Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List

FSTypes.h

Go to the documentation of this file.
00001 /*
00002 Copyright 2003 - 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan
00003 
00004 This file is part of FreeStars, a free clone of the Stars! game.
00005 
00006 FreeStars is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 FreeStars is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with FreeStars; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 The full GPL Copyright notice should be in the file COPYING.txt
00021 
00022 Contact:
00023 Email Elliott at 9jm0tjj02@sneakemail.com
00024 */
00025 
00030 #if !defined(FSTypes_h)
00031 #define FSTypes_h
00032 
00033 typedef long TechType;
00034 typedef long TransferType;
00035 typedef long HabType;
00036 
00037 // accumulate with Trinary op, and third argument
00038 template<class FwdIter, class ReturnType, class TrinaryOp, class Third> inline
00039         ReturnType accumulate(FwdIter First, FwdIter Last, ReturnType Initial, TrinaryOp func, Third arg)
00040         {for (; First != Last; ++First)
00041                 Initial = func(Initial, *First, arg);
00042         return (Initial); }
00043 
00044 // MS random_shuffle has a bug so do this instead
00045 template <class _RandomAccessIter>
00046 inline void Random_Shuffle(_RandomAccessIter __first,
00047                            _RandomAccessIter __last) {
00048   if (__first == __last) return;
00049   for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
00050     iter_swap(__i, __first + genrand_int32() % (__i - __first + 1));
00051 }
00052 
00053 // Versions
00054 #define FREESTARSVERSION        0.1             // overall version
00055 #define HOSTFILEVERSION         0.1             // .hst (host) file format
00056 #define RULESFILEVERSION        0.1             // rules file format
00057 #define TURNFILEVERSION         0.1             // .m (turn file to player) file format
00058 #define ORDERSFILEVERSION       0.1             // .x (orders file from player) file format
00059 #define XYFILEVERSION           0.1             // .xy (galaxy defination) file format
00060 #define RACEFILEVERSION         0.1             // .r (rade defination) file format
00061 
00062 #define epsilon 0.00000001                      // difference needed for comparing doubles to be not equal
00063 
00064 const long PR_SELF              = 4;
00065 const long PR_FRIEND    = 3;
00066 const long PR_NEUTRAL   = 2;
00067 const long PR_ENEMY             = 1;
00068 
00069 const TechType NEXT_CHEAP       = -5;           // Research the field you're closest to getting
00070 const TechType RESEARCH_ALCHEMY = -4;           // Don't do any research, put all leftover points into alchemy
00071 const TechType NEXT_SAME        = -3;
00072 const TechType NEXT_LOW         = -2;
00073 const TechType TECH_NONE        = -1;
00074 
00075 const long MAX_TECH_LEVEL       = 26;
00076 
00077 const TransferType TRANSFER_NOORDER             = 0;
00078 const TransferType TRANSFER_LOADALL             = 1;
00079 const TransferType TRANSFER_UNLOADALL   = 2;
00080 const TransferType TRANSFER_LOADAMT             = 3;
00081 const TransferType TRANSFER_UNLOADAMT   = 4;
00082 const TransferType TRANSFER_FILLPER             = 5;
00083 const TransferType TRANSFER_WAITPER             = 6;    // Affects movement too
00084 const TransferType TRANSFER_LOADDUNN    = 7;    // Load optimal for fuel
00085 const TransferType TRANSFER_AMOUNTTO    = 8;
00086 const TransferType TRANSFER_DESTTO              = 9;
00087 const TransferType TRANSFER_SETTOPER    = 10;   // set to a % of fleet capacity
00088 const TransferType TRANSFER_DROPNLOAD   = 11;   // drop all and then load all. only really useful for pop drops
00089 
00090 typedef unsigned long ComponentType;
00091 const ComponentType CT_NONE                             = 0x00000000;
00092 const ComponentType CT_ARMOR                    = 0x00000001;
00093 const ComponentType CT_SHIELD                   = 0x00000002;
00094 const ComponentType CT_WEAPON                   = 0x00000004;
00095 const ComponentType CT_BOMB                             = 0x00000008;
00096 const ComponentType CT_ELEC                             = 0x00000010;
00097 const ComponentType CT_HULL                             = 0x00000020;
00098 const ComponentType CT_BASE                             = 0x00000040;
00099 const ComponentType CT_PLANSCAN                 = 0x00000080;
00100 const ComponentType CT_DEFENSE                  = 0x00000100;
00101 const ComponentType CT_TERRAFORM                = 0x00000200;
00102 const ComponentType CT_ENGINE                   = 0x00000400;
00103 const ComponentType CT_MINELAY                  = 0x00000800;
00104 const ComponentType CT_MINER                    = 0x00001000;
00105 const ComponentType CT_SCANNER                  = 0x00002000;
00106 const ComponentType CT_MECH                             = 0x00004000;
00107 const ComponentType CT_ALCHEMY                  = 0x00008000;
00108 const ComponentType CT_PLANET_SPECIAL   = 0x00010000;
00109 const ComponentType CT_GATE                             = 0x00020000;
00110 const ComponentType CT_DRIVER                   = 0x00040000;
00111 const ComponentType CT_PLANETARY                = CT_PLANSCAN | CT_DEFENSE | CT_TERRAFORM | CT_PLANET_SPECIAL | CT_ALCHEMY;
00112 const ComponentType CT_ORBITAL                  = CT_DRIVER | CT_GATE;
00113 const ComponentType CT_ALL                              = ~CT_NONE;
00114 const ComponentType CT_GENERAL                  = CT_ALL & ~(CT_BOMB | CT_MINER | CT_ENGINE | CT_ORBITAL | CT_PLANETARY | CT_HULL | CT_BASE);
00115 
00116 typedef unsigned long HullType;
00117 // Hull classes
00118 const HullType HC_NONE          = 0x0000;
00119 const HullType HC_SCOUT         = 0x0001;       // Scout for JOAT scanning
00120 const HullType HC_LAYER         = 0x0002;       // Mine layer 2x mines
00121 const HullType HC_MINICOL       = 0x0004;       // Mini colonizer, for SD engine
00122 const HullType HC_WARSHIP       = 0x0008;
00123 const HullType HC_BOMBER        = 0x0010;
00124 const HullType HC_MINER         = 0x0020;       // Remote miner
00125 const HullType HC_COLONY        = 0x0040;
00126 const HullType HC_FREIGHTER     = 0x0080;
00127 const HullType HC_UTILITY       = 0x0100;
00128 const HullType HC_FUEL          = 0x0200;
00129 const HullType HC_SMALLBASE     = 0x0400;       // Bases without AR pen scanning
00130 const HullType HC_BIGBASE       = 0x0800;       // Bases with AR pen scanning
00131 const HullType HC_ARMED         = 0x1000;       // For battle orders, no hull or component should have this
00132 const HullType HC_UNKNOWN       = 0x2000;       // For Error Checking, no hull or component should have this
00133 const HullType HC_BASE          = HC_SMALLBASE | HC_BIGBASE;
00134 const HullType HC_UNARMED       = HC_COLONY | HC_MINICOL | HC_FREIGHTER | HC_FUEL | HC_MINER;
00135 const HullType HC_COL           = HC_COLONY | HC_MINICOL;
00136 const HullType HC_ALL           = ~HC_NONE;
00137 
00138 
00139 // Random events
00140 const unsigned long RE_NONE             = 0x0000;
00141 const unsigned long RE_MT               = 0x0001;
00142 const unsigned long RE_ARTIFACT = 0x0002;       // artifacts are either on or off, others wait for a start time
00143 const unsigned long RE_COMET    = 0x0004;
00144 const unsigned long RE_WORMHOLE = 0x0008;
00145 const unsigned long RE_ALL              = ~RE_NONE;
00146 
00147 // Public Score Categories
00148 const unsigned long PPS_NONE            = 0x0000;
00149 const unsigned long PPS_PLANET          = 0x0001;
00150 const unsigned long PPS_BASES           = 0x0002;
00151 const unsigned long PPS_UNARM           = 0x0004;
00152 const unsigned long PPS_ESCORT          = 0x0008;
00153 const unsigned long PPS_CAPSHIP         = 0x0010;
00154 const unsigned long PPS_TECH            = 0x0020;
00155 const unsigned long PPS_RESOURCE        = 0x0040;
00156 const unsigned long PPS_SCORE           = 0x0080;
00157 const unsigned long PPS_RANK            = 0x0100;       // rank score is either on or off, others wait for a start time
00158 const unsigned long PPS_ALL                     = ~PPS_NONE;
00159 
00160 #endif // !defined(FSTypes_h)

Generated on Mon Aug 8 21:33:43 2005 for Freestars by  doxygen 1.4.2-20050421