____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include "stratagus.h"
#include "unit.h"
#include "unittype.h"
#include "unit_cache.h"
#include "map.h"
#include "player.h"
Go to the source code of this file.
Functions | |
| CBuildRestrictionOnTop * | OnTopDetails (const CUnit *unit, const CUnitType *parent) |
| CUnit * | CanBuildHere (const CUnit *unit, const CUnitType *type, int x, int y) |
| bool | CanBuildOn (int x, int y, int mask) |
| FIXME: more docu. | |
| CUnit * | CanBuildUnitType (const CUnit *unit, const CUnitType *type, int x, int y, int real) |
| Holds resources. | |
Definition in file build.cpp.
Can build unit here.
| unit | Unit doing the building | |
| type | unit-type to be checked. | |
| x | Map X position. | |
| y | Map Y position. |
Definition at line 239 of file build.cpp.
References CUnitType::BuildingRules, CMap::Field(), CMapField::Flags, CMap::Info, Map, MapFieldCoastAllowed, CMapInfo::MapHeight, CMapInfo::MapWidth, CUnitType::ShoreBuilding, CUnitType::TileHeight, and CUnitType::TileWidth.
Referenced by CanBuildUnitType(), and DrawBuildingCursor().
| bool CanBuildOn | ( | int | x, | |
| int | y, | |||
| int | mask | |||
| ) |
FIXME: more docu.
Can build on this point.
| x | X tile map position. | |
| y | Y tile map position. | |
| mask | terrain mask |
Definition at line 301 of file build.cpp.
References CMap::Field(), CMapField::Flags, CMap::Info, Map, CMapInfo::MapHeight, and CMapInfo::MapWidth.
Referenced by CanBuildUnitType(), and DrawBuildingCursor().
Holds resources.
Can build unit-type at this point.
| unit | Worker that want to build the building or NULL. | |
| type | Building unit-type. | |
| x | X tile map position. | |
| y | Y tile map position. | |
| real | Really build, or just placement |
Definition at line 320 of file build.cpp.
References CanBuildHere(), CanBuildOn(), CMap::IsFieldExplored(), Map, MapFogFilterFlags(), MarkUnitFieldFlags(), CUnitType::MovementMask, CUnit::Player, PlayerPerson, CUnitType::TileHeight, CUnitType::TileWidth, CPlayer::Type, and UnmarkUnitFieldFlags().
Referenced by AiFindBuildingPlace2(), CclCreateUnit(), CheckCanBuild(), EditorCallbackButtonDown(), EditorCallbackMouse(), and UIHandleButtonDown().
| CBuildRestrictionOnTop* OnTopDetails | ( | const CUnit * | unit, | |
| const CUnitType * | parent | |||
| ) |
Find the building restriction that gives me this unit built on top Allows you to define how the restriction is effecting the build
| unit | the unit that is "OnTop" | |
| parent | the parent unit if known. (guess otherwise) |
Definition at line 55 of file build.cpp.
References CBuildRestrictionAnd::_or_list, CUnitType::BuildingRules, CBuildRestrictionOnTop::Parent, and CUnit::Type.
Referenced by EditorActionPlaceUnit(), StartBuilding(), and UnitLost().
1.5.6