C# Класс Sim, plausible-deniability

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
alternatePaths List
lastUnseenTile FP.Vector
networkView NetworkView
tiles ].Tile[
users User[],

Открытые методы

Метод Описание
addStackEvts ( List stackPaths, int nSeeUnits ) : void

adds events to stack specified paths as they arrive

deleteOtherPaths ( IEnumerable segmentUnits, bool addDeleteLines, bool addKeepLines ) : bool

removes units from all other paths that, if seen, could cause specified units to be removed from specified segments; returns whether successful

inVis ( long tX, long tY ) : bool

returns if a hypothetical unit at the origin could see tile with specified (positive or negative) x and y indices

playerNamed ( string name ) : Player,
resourceNamed ( string name ) : int
segmentUnitsWhen ( IEnumerable segmentUnits, long time ) : IEnumerable

iterates over all SegmentUnits active at specified time that are past, present, or future versions of specified SegmentUnits

segmentsWhen ( long time ) : IEnumerable
tileAt ( FP pos ) : Tile,
tileLen ( ) : int
tileVisRadius ( ) : int
unitTypeNamed ( string name ) : UnitType,
unitsCanMake ( List parentUnits, UnitType, type ) : bool
update ( long curTime ) : void

master update method which updates the live game simulation to the specified time

this doesn't update time traveling units, must call updatePast() separately for each player

Приватные методы

Метод Описание
addAncestors ( SegmentUnit, segmentUnit, HashSet ancestors, HashSet prev, HashSet liveToNonLivePrev ) : void
afterDeserialize ( ) : void
afterSerialize ( ) : void
beforeSerialize ( ) : void

Описание методов

addStackEvts() публичный Метод

adds events to stack specified paths as they arrive
public addStackEvts ( List stackPaths, int nSeeUnits ) : void
stackPaths List
nSeeUnits int
Результат void

deleteOtherPaths() публичный Метод

removes units from all other paths that, if seen, could cause specified units to be removed from specified segments; returns whether successful
public deleteOtherPaths ( IEnumerable segmentUnits, bool addDeleteLines, bool addKeepLines ) : bool
segmentUnits IEnumerable
addDeleteLines bool
addKeepLines bool
Результат bool

inVis() публичный Метод

returns if a hypothetical unit at the origin could see tile with specified (positive or negative) x and y indices
public inVis ( long tX, long tY ) : bool
tX long
tY long
Результат bool

playerNamed() публичный Метод

public playerNamed ( string name ) : Player,
name string
Результат Player,

resourceNamed() публичный Метод

public resourceNamed ( string name ) : int
name string
Результат int

segmentUnitsWhen() публичный Метод

iterates over all SegmentUnits active at specified time that are past, present, or future versions of specified SegmentUnits
public segmentUnitsWhen ( IEnumerable segmentUnits, long time ) : IEnumerable
segmentUnits IEnumerable
time long
Результат IEnumerable

segmentsWhen() публичный Метод

public segmentsWhen ( long time ) : IEnumerable
time long
Результат IEnumerable

tileAt() публичный Метод

public tileAt ( FP pos ) : Tile,
pos FP
Результат Tile,

tileLen() публичный Метод

public tileLen ( ) : int
Результат int

tileVisRadius() публичный Метод

public tileVisRadius ( ) : int
Результат int

unitTypeNamed() публичный Метод

public unitTypeNamed ( string name ) : UnitType,
name string
Результат UnitType,

unitsCanMake() публичный Метод

public unitsCanMake ( List parentUnits, UnitType, type ) : bool
parentUnits List
type UnitType,
Результат bool

update() публичный Метод

master update method which updates the live game simulation to the specified time
this doesn't update time traveling units, must call updatePast() separately for each player
public update ( long curTime ) : void
curTime long
Результат void

Описание свойств

alternatePaths публичное свойство

public List alternatePaths
Результат List

lastUnseenTile публичное свойство

public FP.Vector lastUnseenTile
Результат FP.Vector

networkView публичное свойство

public NetworkView networkView
Результат NetworkView

tiles публичное свойство

public Tile[,] tiles
Результат ].Tile[

users публичное свойство

public User[], users
Результат User[],