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

CMapField Class Reference

Describes a field of the map. More...

#include <tile.h>

List of all members.


Public Member Functions

 CMapField ()
bool IsExplored (const unsigned int player_index) const
 A unit on the map field.

Public Attributes

unsigned short Tile
unsigned short SeenTile
 graphic tile number
unsigned short Flags
 last seen tile (FOW)
unsigned char Cost
 field flags
unsigned char Value
 unit cost to move in this tile
unsigned short Visible [PlayerMax]
 HP for walls/ Wood Regeneration.
unsigned short Guard [PlayerMax]
 Seen counter 0 unexplored.
unsigned char VisCloak [PlayerMax]
 Guard counter for autoatack: 0 unguarded.
unsigned char Radar [PlayerMax]
 Visiblity for cloaking.
unsigned char RadarJammer [PlayerMax]
 Visiblity for radar.
CUnitCache UnitCache
 Jamming capabilities.

Detailed Description

Describes a field of the map.

#include "tile.h"

This class contains all information about a field on map. It contains its look, properties and content.

The map-field class members:

CMapField::Tile

Tile is number defining the graphic image display for the map-field. 65535 different tiles are supported. A tile is currently 32x32 pixels. In the future is planned to support animated tiles.

CMapField::SeenTile

This is the tile number, that the player sitting on the computer currently knows. Idea: Can be uses for illusions.

CMapField::Flags

Contains special information of that tile. What units are on this field, what units could be placed on this field.

This is the list of all flags currently used:

MapFieldVisible field is visible. MapFieldExplored field is explored. MapFieldHuman human player is the owner of the field used for walls. MapFieldLandAllowed land units are allowed. MapFieldCoastAllowed coast units (transporter) and coast buildings (shipyard) are allowed. MapFieldWaterAllowed water units allowed. MapFieldNoBuilding no buildings allowed. MapFieldUnpassable field is movement blocked. MapFieldWall field contains wall. MapFieldRocks field contains rocks. MapFieldForest field contains forest. MapFieldLandUnit land unit on field. MapFieldAirUnit air unit on field. MapFieldSeaUnit water unit on field. MapFieldBuilding building on field.

Note: We want to add support for more unit-types like under ground units.

CMapField::Cost

Unit cost to move in this tile.

CMapField::Value

Extra value for each tile. This currently only used for walls, contains the remaining hit points of the wall and for forest, contains the frames until they grow.

CMapField::Visible[]

Counter how many units of the player can see this field. 0 the field is not explored, 1 explored, n-1 unit see it. Currently no more than 253 units can see a field.

CMapField::VisCloak[]

Visiblity for cloaking.

CMapField::Radar[]

Visiblity for radar.

CMapField::RadarJammer[]

Jamming capabilities.

CMapField::UnitCache

Contains a vector of all units currently on this field. Note: currently units are only inserted at the insert point. This means units of the size of 2x2 fields are inserted at the top and right most map coordinate.


Constructor & Destructor Documentation

CMapField::CMapField (  )  [inline]


Member Function Documentation

bool CMapField::IsExplored ( const unsigned int  player_index  )  const [inline]

A unit on the map field.

Check if a field for the user is explored.


Member Data Documentation

unsigned short CMapField::Tile

unsigned short CMapField::SeenTile

graphic tile number

unsigned short CMapField::Flags

last seen tile (FOW)

unsigned char CMapField::Cost

field flags

unsigned char CMapField::Value

unit cost to move in this tile

unsigned short CMapField::Visible[PlayerMax]

HP for walls/ Wood Regeneration.

unsigned short CMapField::Guard[PlayerMax]

Seen counter 0 unexplored.

unsigned char CMapField::VisCloak[PlayerMax]

Guard counter for autoatack: 0 unguarded.

unsigned char CMapField::Radar[PlayerMax]

Visiblity for cloaking.

unsigned char CMapField::RadarJammer[PlayerMax]

Visiblity for radar.

Jamming capabilities.


The documentation for this class was generated from the following file:
(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.