C# Class fCraft.PlayerProximityTracker

Not thread safe.
Show file Open project: GlennMR/800craft Class Usage Examples

Public Methods

Method Description
AddPlayer ( Player p, Vector3I pos ) : void
FindPlayersAtDistance ( Player p ) : IEnumerable
FindPlayersAtDistance ( Player p, double distInBlocks, Func takePair ) : IEnumerable
MovePlayer ( Vector3I oldPos, Vector3I newPos, Player p ) : void
PlayerProximityTracker ( int xSize, int ySize, World world ) : System
RemovePlayer ( Player p ) : void
SetCallEvents ( bool call, double distanceInBlocks, Func takePair ) : void

Private Methods

Method Description
CallEvent ( Player p ) : void
CheckCoords ( Vector3I &pos ) : void
CheckDim ( int &coord, int dim ) : void

Method Details

AddPlayer() public method

public AddPlayer ( Player p, Vector3I pos ) : void
p Player
pos Vector3I
return void

FindPlayersAtDistance() public method

public FindPlayersAtDistance ( Player p ) : IEnumerable
p Player
return IEnumerable

FindPlayersAtDistance() public method

public FindPlayersAtDistance ( Player p, double distInBlocks, Func takePair ) : IEnumerable
p Player
distInBlocks double
takePair Func
return IEnumerable

MovePlayer() public method

public MovePlayer ( Vector3I oldPos, Vector3I newPos, Player p ) : void
oldPos Vector3I
newPos Vector3I
p Player
return void

PlayerProximityTracker() public method

public PlayerProximityTracker ( int xSize, int ySize, World world ) : System
xSize int
ySize int
world World
return System

RemovePlayer() public method

public RemovePlayer ( Player p ) : void
p Player
return void

SetCallEvents() public method

public SetCallEvents ( bool call, double distanceInBlocks, Func takePair ) : void
call bool
distanceInBlocks double
takePair Func
return void