NBTExplorer/Substrate/SubstrateCS/Source/World.cs

57 lines
1.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
2011-04-06 21:20:35 +00:00
namespace Substrate
{
public class World
{
protected RegionManager _regionMan;
protected ChunkManager _chunkMan;
protected BlockManager _blockMan;
protected PlayerManager _playerMan;
protected string _worldPath;
public World (string world)
{
_worldPath = world;
if (Directory.Exists(Path.Combine(world, "region"))) {
_regionMan = new RegionManager(Path.Combine(world, "region"));
_chunkMan = new ChunkManager(_regionMan);
}
else if (Directory.Exists(Path.Combine(world, "0"))) {
//_chunkMan = new ChunkFileManager(world);
}
_blockMan = new BlockManager(_chunkMan);
if (Directory.Exists(Path.Combine(world, "players"))) {
_playerMan = new PlayerManager(Path.Combine(world, "players"));
}
}
public RegionManager GetRegionManager ()
{
return _regionMan;
}
public ChunkManager GetChunkManager ()
{
return _chunkMan;
}
public BlockManager GetBlockManager ()
{
return _blockMan;
}
public PlayerManager GetPlayerManager ()
{
return _playerMan;
}
}
}