#include <BuildAssistant.h>
Inherits SubsystemInterface.
Classes | |
| struct | TileBuildInfo |
Public Types | |
| enum | LocalLegalToBuildOptions { TERRAIN_RESTRICTIONS = 0x00000001 , CLEAR_PATH = 0x00000002 , NO_OBJECT_OVERLAP = 0X00000004 , USE_QUICK_PATHFIND = 0x00000008 , SHROUD_REVEALED = 0x00000010 , NO_ENEMY_OBJECT_OVERLAP = 0x00000020 , IGNORE_STEALTHED = 0x00000040 , FAIL_STEALTHED_WITHOUT_FEEDBACK = 0x00000080 } |
Public Member Functions | |
| BuildAssistant (void) | |
| virtual | ~BuildAssistant (void) |
| virtual void | init (void) |
| for subsytem | |
| virtual void | reset (void) |
| for subsytem | |
| virtual void | update (void) |
| for subsytem | |
| void | iterateFootprint (const ThingTemplate *build, Real buildOrientation, const Coord3D *worldPos, Real sampleResolution, IterateFootprintFunc func, void *funcUserData) |
| iterate the "footprint" area of a structure at the given "sample resolution" | |
| virtual Object * | buildObjectNow (Object *constructorObject, const ThingTemplate *what, const Coord3D *pos, Real angle, Player *owningPlayer) |
| create object from a build and put it in the world now | |
| virtual void | buildObjectLineNow (Object *constructorObject, const ThingTemplate *what, const Coord3D *start, const Coord3D *end, Real angle, Player *owningPlayer) |
| using the "line placement" for objects (like walls etc) create that line of objects line | |
| virtual LegalBuildCode | isLocationLegalToBuild (const Coord3D *worldPos, const ThingTemplate *build, Real angle, UnsignedInt options, Object *builderObject, Player *player) |
| query if we can build at this location | |
| virtual LegalBuildCode | isLocationClearOfObjects (const Coord3D *worldPos, const ThingTemplate *build, Real angle, Object *builderObject, UnsignedInt options, Player *thePlayer) |
| query if we can build at this location | |
| virtual void | addBibs (const Coord3D *worldPos, const ThingTemplate *build) |
| Adds bib highlighting for this location. | |
| virtual TileBuildInfo * | buildTiledLocations (const ThingTemplate *thingBeingTiled, Real angle, const Coord3D *start, const Coord3D *end, Real tilingSize, Int maxTiles, Object *builderObject) |
| tiling wall object helper function, we can use this to "tile" walls when building | |
| virtual Coord3D * | getBuildLocations (void) |
| return the "scratch pad" array that can be used to create a line of build locations | |
| virtual Bool | isLineBuildTemplate (const ThingTemplate *tTemplate) |
| is the template a line build object, like a wall | |
| virtual CanMakeType | canMakeUnit (Object *builder, const ThingTemplate *whatToBuild) const |
| are all the requirements for making this unit satisfied | |
| virtual Bool | isPossibleToMakeUnit (Object *builder, const ThingTemplate *whatToBuild) const |
| are all the requirements for making this unit (except available cash) are satisfied | |
| virtual void | sellObject (Object *obj) |
| sell an object | |
| void | xferTheSellList (Xfer *xfer) |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Protected Member Functions | |
| Bool | isRemovableForConstruction (Object *obj) |
| some objects will be "cleared" automatically when constructing | |
| void | clearRemovableForConstruction (const ThingTemplate *whatToBuild, const Coord3D *pos, Real angle) |
| clear the area of removable objects for construction | |
| Bool | moveObjectsForConstruction (const ThingTemplate *whatToBuild, const Coord3D *pos, Real angle, Player *playerToBuild) |
Protected Attributes | |
| Coord3D * | m_buildPositions |
| array used to create a line of build locations (think walls) | |
| Int | m_buildPositionSize |
| number of elements in the build position array | |
| ObjectSellList | m_sellList |
| list of objects currently going through the "sell process" | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
Definition at line 103 of file BuildAssistant.h.
Definition at line 114 of file BuildAssistant.h.
| BuildAssistant::BuildAssistant | ( | void | ) |
Definition at line 113 of file BuildAssistant.cpp.
|
virtual |
Definition at line 123 of file BuildAssistant.cpp.
|
virtual |
Adds bib highlighting for this location.
Adds bibs to structures near to worldPos
Definition at line 1073 of file BuildAssistant.cpp.
|
virtual |
using the "line placement" for objects (like walls etc) create that line of objects line
This method will create a line of objects end to end along the line defined in 3D space from start to end. This is especially useful in building walls
Definition at line 454 of file BuildAssistant.cpp.
|
virtual |
create object from a build and put it in the world now
Nice little method to wrap up creating an object from a build
Definition at line 333 of file BuildAssistant.cpp.
|
virtual |
tiling wall object helper function, we can use this to "tile" walls when building
Tiling wall object helper function, we can use this to "tile" walls when building. This function will fill out the ARRAY world positions named 'positions' starting at the 'start' point in the world and going to the 'end' point in the world. No more than 'maxTiles' will be considered and if the position of any one of the objects in the chain is illegal the chain stops there. The number of objects actually used for the tiling is returned along with a pointer to the array of positions in the tile build info.
REQUIRES: Note that the array at 'postions' must be large enough to hold 'maxTiles' entries of positions
Definition at line 1114 of file BuildAssistant.cpp.
|
virtual |
are all the requirements for making this unit satisfied
This method will check to make sure it is possible to build the requested unit. and that the player has enough money for 'whatToBuild'
Definition at line 1303 of file BuildAssistant.cpp.
|
protected |
clear the area of removable objects for construction
Given that we are about to build 'whatToBuild' remove all the objects that are in the 'footprint' of where the build will take place that can be auto-removed for construction
Definition at line 1389 of file BuildAssistant.cpp.
|
inlinevirtual |
return the "scratch pad" array that can be used to create a line of build locations
Definition at line 180 of file BuildAssistant.h.
|
virtual |
|
virtual |
is the template a line build object, like a wall
Is the template passed in one of those wall type structures that we "build" in the world after drawing a line of where we want the object(s) placed. The objects are placed "tiled" in a line
Definition at line 1224 of file BuildAssistant.cpp.
|
virtual |
query if we can build at this location
Check for objects preventing building at this location.
Definition at line 666 of file BuildAssistant.cpp.
|
virtual |
query if we can build at this location
Query if we can build at this location. Note that 'build' may be null and is NOT required to be valid to know if a location is legal to build at. 'builderObject' is used for queries that require a pathfind check and should be NULL if not required
todo remove this if we need to change the semantics of this function of the builderObject actually being able to get to the destination
Definition at line 908 of file BuildAssistant.cpp.
|
virtual |
are all the requirements for making this unit (except available cash) are satisfied
This method will check to make sure it is possible to build the requested unit. The builder object MUST be present since all construction comes comes from either a Dozer or a production building. The player must have satisfied the prereqs for 'whatToBuild' This does NOT check available money (see canMakeUnit)
Definition at line 1243 of file BuildAssistant.cpp.
some objects will be "cleared" automatically when constructing
Some objects will be automatically removed when something is built on them so they aren't considered as obstacles when placing them
Definition at line 1355 of file BuildAssistant.cpp.
| void BuildAssistant::iterateFootprint | ( | const ThingTemplate * | build, |
| Real | buildOrientation, | ||
| const Coord3D * | worldPos, | ||
| Real | sampleResolution, | ||
| IterateFootprintFunc | func, | ||
| void * | funcUserData ) |
iterate the "footprint" area of a structure at the given "sample resolution"
This function will call the user callback at each "sample point" across the footprint of where this object would be in the world. The smaller the sample resolution param is the more samples will be taken across the footprint area
Definition at line 554 of file BuildAssistant.cpp.
|
protected |
will move objects that can move out of the way. will return false if there are objects that cannot be moved out of the way.
clearRemovable is set up to delete objects that should cease to exist (for instance, trees). moveObjects will move objects that are owned by the player. It will also return false if the association with the object is enemy. (We can move neutral things)
Definition at line 1416 of file BuildAssistant.cpp.
|
virtual |
|
virtual |
sell an object
Start the process for selling the object in question
Definition at line 1499 of file BuildAssistant.cpp.
|
virtual |
for subsytem
Update phase for the build assistant
Implements SubsystemInterface.
Definition at line 181 of file BuildAssistant.cpp.
| void BuildAssistant::xferTheSellList | ( | Xfer * | xfer | ) |
Xfer the sell list.
Definition at line 295 of file BuildAssistant.cpp.
|
protected |
array used to create a line of build locations (think walls)
Definition at line 210 of file BuildAssistant.h.
|
protected |
number of elements in the build position array
Definition at line 211 of file BuildAssistant.h.
|
protected |
list of objects currently going through the "sell process"
Definition at line 212 of file BuildAssistant.h.