_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes
build.cpp File Reference
#include "stratagus.h"
#include "unittype.h"
#include "actions.h"
#include "map.h"
#include "player.h"
#include "unit.h"
#include "unit_find.h"

Classes

class  AliveConstructedAndSameTypeAs
 

Functions

build.cpp - The units.
CBuildRestrictionOnTopOnTopDetails (const CUnit &unit, const CUnitType *parent)
 Return the rule used to build this building. More...
 
CUnitCanBuildHere (const CUnit *unit, const CUnitType &type, const Vec2i &pos)
 
bool CanBuildOn (const Vec2i &pos, int mask)
 
CUnitCanBuildUnitType (const CUnit *unit, const CUnitType &type, const Vec2i &pos, int real)
 FIXME: more docu. More...
 

Function Documentation

◆ CanBuildHere()

CUnit* CanBuildHere ( const CUnit unit,
const CUnitType type,
const Vec2i pos 
)

Can build unit here. Hall too near to goldmine. Refinery or shipyard too near to oil patch.

Parameters
unitUnit doing the building
typeunit-type to be checked.
posMap position.
Returns
OnTop, parent unit, builder on true or 1 if unit==NULL, NULL false.

◆ CanBuildOn()

bool CanBuildOn ( const Vec2i pos,
int  mask 
)

Can build on this point.

Parameters
postile map position.
maskterrain mask
Returns
true if we can build on this point.

◆ CanBuildUnitType()

CUnit* CanBuildUnitType ( const CUnit unit,
const CUnitType type,
const Vec2i pos,
int  real 
)

FIXME: more docu.

Can build unit-type at this point.

Parameters
unitWorker that want to build the building or NULL.
typeBuilding unit-type.
postile map position.
realReally build, or just placement
Returns
OnTop, parent unit, builder on true, NULL false.

◆ OnTopDetails()

CBuildRestrictionOnTop* OnTopDetails ( const CUnit unit,
const CUnitType parent 
)

Return the rule used to build this building.

Find the building restriction that gives me this unit built on top Allows you to define how the restriction is effecting the build

Parameters
unitthe unit that is "OnTop"
parentthe parent unit if known. (guess otherwise)
Returns
the BuildingRestrictionDetails
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.