C# Class fCraft.WorldManager

Manages the world list. Handles loading/unloading, renaming, map changes, and more.
Show file Open project: GlennMR/800craft Class Usage Examples

Private Properties

Property Type Description
CheckMapFile void
FindMapFile string
FindWorldExact World
FindWorldOrPrintMatches World
LoadWorldList bool
LoadWorldListEntry void
RaiseMainWorldChangedEvent void
RaiseMainWorldChangingEvent bool
RaiseWorldCreatedEvent void
RaiseWorldCreatingEvent bool
ReplaceWorld void

Public Methods

Method Description
AddWorld ( [ player, [ name, [ map, bool neverUnload ) : World
CountLoadedWorlds ( ) : int
CountLoadedWorlds ( [ observer ) : int
FindWorlds ( [ player, [ name ) : fCraft.World[]

Finds all worlds that match the given name. Autocompletes. Raises SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.

FindWorldsNoEvent ( [ name ) : fCraft.World[]

Finds all worlds that match the given world name. Autocompletes. Does not raise SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.

ListLoadedWorlds ( ) : IEnumerable
ListLoadedWorlds ( [ observer ) : IEnumerable
RemoveWorld ( [ worldToDelete ) : void
RenameWorld ( [ world, [ newName, bool moveMapFile, bool overwrite ) : void

Changes the name of the given world.

SaveWorldList ( ) : void

Saves the current world list to worlds.xml. Thread-safe.

UpdateWorldList ( ) : void

Private Methods

Method Description
CheckMapFile ( [ world ) : void
FindMapFile ( [ player, [ fileName ) : string
FindWorldExact ( [ name ) : World
FindWorldOrPrintMatches ( [ player, [ worldName ) : World
LoadWorldList ( ) : bool
LoadWorldListEntry ( [ el ) : void
RaiseMainWorldChangedEvent ( [ oldWorld, [ newWorld ) : void
RaiseMainWorldChangingEvent ( World oldWorld, [ newWorld ) : bool
RaiseWorldCreatedEvent ( [ player, [ world ) : void
RaiseWorldCreatingEvent ( [ player, [ worldName, [ map ) : bool
ReplaceWorld ( [ oldWorld, [ newWorld ) : void

Method Details

AddWorld() public static method

public static AddWorld ( [ player, [ name, [ map, bool neverUnload ) : World
player [
name [
map [
neverUnload bool
return World

CountLoadedWorlds() public static method

public static CountLoadedWorlds ( ) : int
return int

CountLoadedWorlds() public static method

public static CountLoadedWorlds ( [ observer ) : int
observer [
return int

FindWorlds() public static method

Finds all worlds that match the given name. Autocompletes. Raises SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.
public static FindWorlds ( [ player, [ name ) : fCraft.World[]
player [ Player who is calling the query. May be null.
name [ Full or partial world name.
return fCraft.World[]

FindWorldsNoEvent() public static method

Finds all worlds that match the given world name. Autocompletes. Does not raise SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.
public static FindWorldsNoEvent ( [ name ) : fCraft.World[]
name [
return fCraft.World[]

ListLoadedWorlds() public static method

public static ListLoadedWorlds ( ) : IEnumerable
return IEnumerable

ListLoadedWorlds() public static method

public static ListLoadedWorlds ( [ observer ) : IEnumerable
observer [
return IEnumerable

RemoveWorld() public static method

public static RemoveWorld ( [ worldToDelete ) : void
worldToDelete [
return void

RenameWorld() public static method

Changes the name of the given world.
public static RenameWorld ( [ world, [ newName, bool moveMapFile, bool overwrite ) : void
world [
newName [
moveMapFile bool
overwrite bool
return void

SaveWorldList() public static method

Saves the current world list to worlds.xml. Thread-safe.
public static SaveWorldList ( ) : void
return void

UpdateWorldList() public static method

public static UpdateWorldList ( ) : void
return void