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

Classes | Public Member Functions | List of all members
CFieldOfView Class Reference

Select algorithm for field of view. More...

#include <fov.h>

Public Member Functions

void Clean ()
 

fov.cpp - The field of view handling.

void Refresh (const CPlayer &player, const CUnit &unit, const Vec2i &pos, const uint16_t width, const uint16_t height, const uint16_t range, MapMarkerFunc *marker)
 Refresh field of view. More...
 
bool SetType (const FieldOfViewTypes fov_type)
 
FieldOfViewTypes GetType () const
 
void SetOpaqueFields (const uint16_t flags)
 Set opaque map field flags (which fields will be opaque) More...
 
uint16_t GetOpaqueFields () const
 
void ResetAdditionalOpaqueFields ()
 Reset opaque flags to default (MapFieldOpaque) More...
 

Detailed Description

Select algorithm for field of view.

Member Function Documentation

◆ Clean()

void CFieldOfView::Clean ( )
inline

◆ GetOpaqueFields()

uint16_t CFieldOfView::GetOpaqueFields ( ) const

Returns current set of opaque map field flags

Returns
Set of terrain flags

◆ GetType()

FieldOfViewTypes CFieldOfView::GetType ( ) const

Returns used type of Field of View

Returns
current Field of View type

◆ Refresh()

void CFieldOfView::Refresh ( const CPlayer player,
const CUnit unit,
const Vec2i pos,
const uint16_t  width,
const uint16_t  height,
const uint16_t  range,
MapMarkerFunc marker 
)

Refresh field of view.

Refresh the whole field of view for unit (Explore and make visible.)

Parameters
playerplayer to mark the sight for
unitunit to mark the sight for
poslocation to mark
widthwidth to mark, in square
heightheight to mark, in square
rangeRadius to mark.
markerFunction to mark or unmark sight

FIXME: sometimes when quit from game this assert is triggered

FIXME: add high-/lowground

because of rocks-flag is used as an obstacle for ranged attackers

◆ ResetAdditionalOpaqueFields()

void CFieldOfView::ResetAdditionalOpaqueFields ( )

Reset opaque flags to default (MapFieldOpaque)

Reset opaque map field flags to default (MapfieldOpaque)

◆ SetOpaqueFields()

void CFieldOfView::SetOpaqueFields ( const uint16_t  flags)

Set opaque map field flags (which fields will be opaque)

Set additional opaque map field flags (which terrains will be opaque)

Parameters
flagsTerrain flags to set as opaque (MapField*)

Unmark sight for all units

Mark sight with new fov type for all units

◆ SetType()

bool CFieldOfView::SetType ( const FieldOfViewTypes  fov_type)

Select which type of Field of View to use

Parameters
fov_typetype to set
Returns
true if success, false for wrong fov_type

Unmark sight for all units

Mark sight with new fov type for all units


The documentation for this class was generated from the following files:
(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.