C# Class Sim, plausible-deniability

Show file Open project: ad510/plausible-deniability Class Usage Examples

Public Properties

Property Type Description
alternatePaths List
lastUnseenTile FP.Vector
networkView NetworkView
tiles ].Tile[
users User[],

Public Methods

Method Description
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

Private Methods

Method Description
addAncestors ( SegmentUnit, segmentUnit, HashSet ancestors, HashSet prev, HashSet liveToNonLivePrev ) : void
afterDeserialize ( ) : void
afterSerialize ( ) : void
beforeSerialize ( ) : void

Method Details

addStackEvts() public method

adds events to stack specified paths as they arrive
public addStackEvts ( List stackPaths, int nSeeUnits ) : void
stackPaths List
nSeeUnits int
return void

deleteOtherPaths() public method

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
return bool

inVis() public method

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
return bool

playerNamed() public method

public playerNamed ( string name ) : Player,
name string
return Player,

resourceNamed() public method

public resourceNamed ( string name ) : int
name string
return int

segmentUnitsWhen() public method

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
return IEnumerable

segmentsWhen() public method

public segmentsWhen ( long time ) : IEnumerable
time long
return IEnumerable

tileAt() public method

public tileAt ( FP pos ) : Tile,
pos FP
return Tile,

tileLen() public method

public tileLen ( ) : int
return int

tileVisRadius() public method

public tileVisRadius ( ) : int
return int

unitTypeNamed() public method

public unitTypeNamed ( string name ) : UnitType,
name string
return UnitType,

unitsCanMake() public method

public unitsCanMake ( List parentUnits, UnitType, type ) : bool
parentUnits List
type UnitType,
return bool

update() public method

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
return void

Property Details

alternatePaths public property

public List alternatePaths
return List

lastUnseenTile public property

public FP.Vector lastUnseenTile
return FP.Vector

networkView public property

public NetworkView networkView
return NetworkView

tiles public property

public Tile[,] tiles
return ].Tile[

users public property

public User[], users
return User[],