summaryrefslogtreecommitdiff
path: root/src/object_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-18 23:09:43 +0000
committerrubidium <rubidium@openttd.org>2011-01-18 23:09:43 +0000
commit9ca4b629cd91c2749d9efafd752fc5175ebce5fd (patch)
tree24da99d42f3e33eb7f4109462dcced5adc6eab15 /src/object_cmd.cpp
parent7efd7e19ed046a4a0c03077f27930291ba5b9725 (diff)
downloadopenttd-9ca4b629cd91c2749d9efafd752fc5175ebce5fd.tar.xz
(svn r21846) -Codechange: move documentation towards the code to make it more likely to be updated [o-s].
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r--src/object_cmd.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 499790579..b8361cdbd 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -43,6 +43,11 @@ ObjectPool _object_pool("Object");
INSTANTIATE_POOL_METHODS(Object)
uint16 Object::counts[NUM_OBJECTS];
+/**
+ * Get the object associated with a tile.
+ * @param tile The tile to fetch the object for.
+ * @return The object.
+ */
/* static */ Object *Object::GetByTile(TileIndex tile)
{
return Object::Get(GetObjectIndex(tile));
@@ -55,6 +60,16 @@ void InitializeObjects()
Object::ResetTypeCounts();
}
+/**
+ * Actually build the object.
+ * @param type The type of object to build.
+ * @param tile The tile to build the northern tile of the object on.
+ * @param owner The owner of the object.
+ * @param town Town the tile is related with.
+ * @param view The view for the object.
+ * @pre All preconditions for building the object at that location
+ * are met, e.g. slope and clearness of tiles are checked.
+ */
void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, uint8 view)
{
const ObjectSpec *spec = ObjectSpec::Get(type);
@@ -113,6 +128,11 @@ static void IncreaseAnimationStage(TileIndex tile)
/** We encode the company HQ size in the animation stage. */
#define IncreaseCompanyHQSize IncreaseAnimationStage
+/**
+ * Update the CompanyHQ to the state associated with the given score
+ * @param tile The (northern) tile of the company HQ, or INVALID_TILE.
+ * @param score The current (performance) score of the company.
+ */
void UpdateCompanyHQ(TileIndex tile, uint score)
{
if (tile == INVALID_TILE) return;