Class LocalChunkCache
Chunk Cache für lokale Anwendungen.
Vererbung
Implementiert
Namespace: OctoAwesome
Assembly: OctoAwesome.dll
Syntax
public class LocalChunkCache : object, ILocalChunkCache
Konstructoren
LocalChunkCache(IGlobalChunkCache, Boolean, Int32, Int32)
Instanziert einen neuen local Chunk Cache.
Deklaration
public LocalChunkCache(IGlobalChunkCache globalCache, bool passive, int dimensions, int range)
Parameter
Typ | Name | Beschreibung |
---|---|---|
IGlobalChunkCache | globalCache | Referenz auf global Chunk Cache |
System.Boolean | passive | |
System.Int32 | dimensions | Größe des Caches in Zweierpotenzen |
System.Int32 | range | Gibt die Range in alle Richtungen an. |
Eigenschaften
CenterPosition
Deklaration
public Index2 CenterPosition { get; set; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
Index2 |
IsPassive
Deklaration
public bool IsPassive { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
System.Boolean |
Planet
Aktueller Planet auf dem sich der Cache bezieht.
Deklaration
public IPlanet Planet { get; }
Wert der Eigenschaft
Typ | Beschreibung |
---|---|
IPlanet |
Methoden
Flush()
Leert den Cache und gibt sie beim GlobalChunkCache wieder frei
Deklaration
public void Flush()
GetBlock(Index3)
Liefert den Block an der angegebenen Block-Koodinate zurück.
Deklaration
public ushort GetBlock(Index3 index)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | index | Block Index |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.UInt16 | Die Block-ID an der angegebenen Koordinate |
GetBlock(Int32, Int32, Int32)
Liefert den Block an der angegebenen Block-Koodinate zurück.
Deklaration
public ushort GetBlock(int x, int y, int z)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X-Anteil der Koordinate des Blocks |
System.Int32 | y | Y-Anteil der Koordinate des Blocks |
System.Int32 | z | Z-Anteil der Koordinate des Blocks |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.UInt16 | Die Block-ID an der angegebenen Koordinate |
GetBlockMeta(Index3)
Gibt die Metadaten des Blocks an der angegebenen Koordinate zurück.
Deklaration
public int GetBlockMeta(Index3 index)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | index | Block-Koordinate |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 | Die Metadaten des angegebenen Blocks |
GetBlockMeta(Int32, Int32, Int32)
Gibt die Metadaten des Blocks an der angegebenen Koordinate zurück.
Deklaration
public int GetBlockMeta(int x, int y, int z)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | y | Y-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | z | Z-Anteil der Koordinate des Blocks innerhalb des Chunks |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Int32 | Die Metadaten des angegebenen Blocks |
GetChunk(Index3)
Liefert den Chunk an der angegebenen Chunk-Koordinate zurück.
Deklaration
public IChunk GetChunk(Index3 index)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | index | Chunk Index |
R�ckgabewert
Typ | Beschreibung |
---|---|
IChunk | Instanz des Chunks |
GetChunk(Int32, Int32, Int32)
Liefert den Chunk an der angegebenen Chunk-Koordinate zurück.
Deklaration
public IChunk GetChunk(int x, int y, int z)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X Koordinate |
System.Int32 | y | Y Koordinate |
System.Int32 | z | Z Koordinate |
R�ckgabewert
Typ | Beschreibung |
---|---|
IChunk | Instanz des Chunks |
LoadPlanet(Int32)
Deklaration
public IPlanet LoadPlanet(int id)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | id |
R�ckgabewert
Typ | Beschreibung |
---|---|
IPlanet |
SetBlock(Index3, UInt16)
Überschreibt den Block an der angegebenen Koordinate.
Deklaration
public void SetBlock(Index3 index, ushort block)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | index | Block-Koordinate |
System.UInt16 | block | Die neue Block-ID. |
SetBlock(Int32, Int32, Int32, UInt16)
Überschreibt den Block an der angegebenen Koordinate.
Deklaration
public void SetBlock(int x, int y, int z, ushort block)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | y | Y-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | z | Z-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.UInt16 | block | Die neue Block-ID |
SetBlockMeta(Index3, Int32)
Ändert die Metadaten des Blockes an der angegebenen Koordinate.
Deklaration
public void SetBlockMeta(Index3 index, int meta)
Parameter
Typ | Name | Beschreibung |
---|---|---|
Index3 | index | Block-Koordinate |
System.Int32 | meta | Die neuen Metadaten |
SetBlockMeta(Int32, Int32, Int32, Int32)
Ändert die Metadaten des Blockes an der angegebenen Koordinate.
Deklaration
public void SetBlockMeta(int x, int y, int z, int meta)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | x | X-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | y | Y-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | z | Z-Anteil der Koordinate des Blocks innerhalb des Chunks |
System.Int32 | meta | Die neuen Metadaten |
SetCenter(IPlanet, Index2, Action<Boolean>)
Setzt den Zentrums-Chunk für diesen lokalen Cache.
Deklaration
public bool SetCenter(IPlanet planet, Index2 index, Action<bool> successCallback = null)
Parameter
Typ | Name | Beschreibung |
---|---|---|
IPlanet | planet | Der Planet, auf dem sich der Chunk befindet |
Index2 | index | Die Koordinaten an der sich der Chunk befindet |
Action<System.Boolean> | successCallback | Routine die Aufgerufen werden soll, falls das setzen erfolgreich war oder nicht |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Boolean |
SetCenter(Int32, Index2, Action<Boolean>)
Setzt den Zentrums-Chunk für diesen lokalen Cache.
Deklaration
public bool SetCenter(int planetid, Index2 index, Action<bool> successCallback = null)
Parameter
Typ | Name | Beschreibung |
---|---|---|
System.Int32 | planetid | ID des Planet, auf dem sich der Chunk befindet |
Index2 | index | Die Koordinaten an der sich der Chunk befindet |
Action<System.Boolean> | successCallback | Routine die Aufgerufen werden soll, falls das setzen erfolgreich war oder nicht |
R�ckgabewert
Typ | Beschreibung |
---|---|
System.Boolean |