C# Class fCraft.World

World instance
Inheritance: IClassy
Show file Open project: GlennMR/800craft Class Usage Examples

Public Properties

Property Type Description
CloudColor int
EdgeBlock Block
Feeds FeedData>.Dictionary
FireworkCount int
GameOn bool
Games List
Greeting string
LockedBy string
LockedDate System.DateTime
RealisticEnv bool
RealmXMLRootName string
SideBlock Block
ZombieGame bool
blockCache Vector3I>.ConcurrentDictionary
blueScore int
blueTeam List
fireworkPhysics bool
footballPos Vector3I
gameMode GameMode
gunPhysics bool
map Map
plantPhysics bool
positions fCraft.Player[
redScore int
redTeam List
sandPhysics bool
tntPhysics bool
waterPhysics bool

Private Properties

Property Type Description
AcceptPlayer Map
AddPhysicsTask void
AddPlantTask void
AddTask void
AddTasksFromNewMap void
CheckIfPhysicsStarted void
CheckIfToStopPhysics void
DeleteOldBackups void
EndFlushMapBuffer void
FindPlayerExact Player
LoadMap Map
SaveTask void
StartScheduler void
StartTasks void
StopSchedulers void
StopTasks void
UnloadMap void
UpdateTask void
World System

Public Methods

Method Description
ChangeMap ( [ newMap ) : void
CountPlayers ( bool includeHiddenPlayers ) : int

Counts all players (optionally includes all hidden players).

CountVisiblePlayers ( [ observer ) : int

Counts only the players who are not hidden from a given observer.

DeleteLife ( string name ) : void
DisableFireworkPhysics ( Player player, bool announce ) : void
DisableGunPhysics ( Player player, bool announce ) : void
DisablePlantPhysics ( Player player, bool announce ) : void
DisableSandPhysics ( Player player, bool announce ) : void
DisableTNTPhysics ( Player player, bool announce ) : void
DisableWaterPhysics ( Player player, bool announce ) : void
EnableFireworkPhysics ( Player player, bool announce ) : void
EnableGunPhysics ( Player player, bool announce ) : void
EnablePlantPhysics ( Player player, bool announce ) : void
EnableSandPhysics ( Player player, bool announce ) : void
EnableTNTPhysics ( Player player, bool announce ) : void
EnableWaterPhysics ( Player player, bool announce ) : void
FindPlayers ( [ player, [ playerName ) : fCraft.Player[]
Flush ( ) : void
GenerateWoMConfig ( bool sendMotd ) : string
GetLife ( string name ) : Life2DZone
GetLifes ( ) : IEnumerable
GetNextPatrolTarget ( [ observer ) : Player
GetNextPatrolTarget ( [ observer, [ predicate, bool setLastPatrolTime ) : Player
IsValidName ( [ name ) : bool

Ensures that player name has the correct length (2-16 characters) and character set (alphanumeric chars and underscores allowed).

LoadRealmState ( System.Xml.Linq.XElement el ) : void
Lock ( [ player ) : bool
ReleasePlayer ( [ player ) : bool
SaveBackup ( [ targetName ) : bool

Makes a copy of the current map file associated with this world. This does NOT save map to disk, and does NOT guarantee that the most up-to-date copy of the map was backed up.

SaveMap ( ) : void
SaveRealmState ( ) : System.Xml.Linq.XElement
SaveRealmState ( string rootName ) : System.Xml.Linq.XElement
ToString ( ) : string
TryAddLife ( Life2DZone life ) : bool
Unlock ( [ player ) : bool
UpdatePlayerList ( ) : void

Caches the player list to an array (Players -> PlayerList)

Private Methods

Method Description
AcceptPlayer ( [ player, bool announce ) : Map
AddPhysicsTask ( PhysicsTask task, int Delay ) : void
AddPlantTask ( short x, short y, short z ) : void
AddTask ( TaskCategory cat, PhysicsTask task, int Delay ) : void
AddTasksFromNewMap ( ) : void
CheckIfPhysicsStarted ( ) : void
CheckIfToStopPhysics ( ) : void
DeleteOldBackups ( [ directory ) : void
EndFlushMapBuffer ( ) : void
FindPlayerExact ( [ playerName ) : Player
LoadMap ( ) : Map
SaveTask ( SchedulerTask task ) : void
StartScheduler ( TaskCategory cat ) : void
StartTasks ( ) : void
StopSchedulers ( ) : void
StopTasks ( ) : void
UnloadMap ( bool expectedPendingFlag ) : void
UpdateTask ( SchedulerTask task ) : void
World ( [ name ) : System

Method Details

ChangeMap() public method

public ChangeMap ( [ newMap ) : void
newMap [
return void

CountPlayers() public method

Counts all players (optionally includes all hidden players).
public CountPlayers ( bool includeHiddenPlayers ) : int
includeHiddenPlayers bool
return int

CountVisiblePlayers() public method

Counts only the players who are not hidden from a given observer.
public CountVisiblePlayers ( [ observer ) : int
observer [
return int

DeleteLife() public method

public DeleteLife ( string name ) : void
name string
return void

DisableFireworkPhysics() public method

public DisableFireworkPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

DisableGunPhysics() public method

public DisableGunPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

DisablePlantPhysics() public method

public DisablePlantPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

DisableSandPhysics() public method

public DisableSandPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

DisableTNTPhysics() public method

public DisableTNTPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

DisableWaterPhysics() public method

public DisableWaterPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnableFireworkPhysics() public method

public EnableFireworkPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnableGunPhysics() public method

public EnableGunPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnablePlantPhysics() public method

public EnablePlantPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnableSandPhysics() public method

public EnableSandPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnableTNTPhysics() public method

public EnableTNTPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

EnableWaterPhysics() public method

public EnableWaterPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void

FindPlayers() public method

public FindPlayers ( [ player, [ playerName ) : fCraft.Player[]
player [
playerName [
return fCraft.Player[]

Flush() public method

public Flush ( ) : void
return void

GenerateWoMConfig() public method

public GenerateWoMConfig ( bool sendMotd ) : string
sendMotd bool
return string

GetLife() public method

public GetLife ( string name ) : Life2DZone
name string
return Life2DZone

GetLifes() public method

public GetLifes ( ) : IEnumerable
return IEnumerable

GetNextPatrolTarget() public method

public GetNextPatrolTarget ( [ observer ) : Player
observer [
return Player

GetNextPatrolTarget() public method

public GetNextPatrolTarget ( [ observer, [ predicate, bool setLastPatrolTime ) : Player
observer [
predicate [
setLastPatrolTime bool
return Player

IsValidName() public static method

Ensures that player name has the correct length (2-16 characters) and character set (alphanumeric chars and underscores allowed).
public static IsValidName ( [ name ) : bool
name [
return bool

LoadRealmState() public method

public LoadRealmState ( System.Xml.Linq.XElement el ) : void
el System.Xml.Linq.XElement
return void

Lock() public method

public Lock ( [ player ) : bool
player [
return bool

ReleasePlayer() public method

public ReleasePlayer ( [ player ) : bool
player [
return bool

SaveBackup() public method

Makes a copy of the current map file associated with this world. This does NOT save map to disk, and does NOT guarantee that the most up-to-date copy of the map was backed up.
targetName is null.
public SaveBackup ( [ targetName ) : bool
targetName [ Target file name.
return bool

SaveMap() public method

public SaveMap ( ) : void
return void

SaveRealmState() public method

public SaveRealmState ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement

SaveRealmState() public method

public SaveRealmState ( string rootName ) : System.Xml.Linq.XElement
rootName string
return System.Xml.Linq.XElement

ToString() public method

public ToString ( ) : string
return string

TryAddLife() public method

public TryAddLife ( Life2DZone life ) : bool
life Life2DZone
return bool

Unlock() public method

public Unlock ( [ player ) : bool
player [
return bool

UpdatePlayerList() public method

Caches the player list to an array (Players -> PlayerList)
public UpdatePlayerList ( ) : void
return void

Property Details

CloudColor public property

public int CloudColor
return int

EdgeBlock public property

public Block EdgeBlock
return Block

Feeds public property

public Dictionary Feeds
return FeedData>.Dictionary

FireworkCount public property

public int FireworkCount
return int

GameOn public property

public bool GameOn
return bool

Games public property

public List Games
return List

Greeting public property

public string Greeting
return string

LockedBy public property

public string LockedBy
return string

LockedDate public property

public DateTime,System LockedDate
return System.DateTime

RealisticEnv public property

public bool RealisticEnv
return bool

RealmXMLRootName public property

public string RealmXMLRootName
return string

SideBlock public property

public Block SideBlock
return Block

ZombieGame public property

public bool ZombieGame
return bool

blockCache public property

public ConcurrentDictionary blockCache
return Vector3I>.ConcurrentDictionary

blueScore public property

public int blueScore
return int

blueTeam public property

public List blueTeam
return List

fireworkPhysics public property

public bool fireworkPhysics
return bool

footballPos public property

public Vector3I footballPos
return Vector3I

gameMode public property

public GameMode gameMode
return GameMode

gunPhysics public property

public bool gunPhysics
return bool

map public property

public Map,fCraft map
return Map

plantPhysics public property

public bool plantPhysics
return bool

positions public property

public Player[,fCraft positions
return fCraft.Player[

redScore public property

public int redScore
return int

redTeam public property

public List redTeam
return List

sandPhysics public property

public bool sandPhysics
return bool

tntPhysics public property

public bool tntPhysics
return bool

waterPhysics public property

public bool waterPhysics
return bool