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

src/unit/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.
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)

Function Documentation

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:
unit Unit doing the building
type unit-type to be checked.
pos Map position.
Returns:
OnTop, parent unit, builder on true or 1 if unit==NULL, NULL false.

bool CanBuildOn ( const Vec2i pos,
int  mask 
)

Can build on this point.

Parameters:
pos tile map position.
mask terrain mask
Returns:
true if we can build on this point.

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

Can build unit-type at this point.

Parameters:
unit Worker that want to build the building or NULL.
type Building unit-type.
pos tile map position.
real Really build, or just placement
Returns:
OnTop, parent unit, builder on true, NULL false.

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:
unit the unit that is "OnTop"
parent the 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.