public Region generateRegion(String _Name, int _PosX, int _PosY, RegionEnum _RegionEnum, World _ParentWorld) { switch (_RegionEnum) { case RegionEnum.Grassland: { return generateRegionGrassland(_Name, _PosX, _PosY, _ParentWorld); } case RegionEnum.Snowland: { return generateRegionSnowland(_Name, _PosX, _PosY, _ParentWorld); } case RegionEnum.Lavaland: { return generateRegionLavaland(_Name, _PosX, _PosY, _ParentWorld); } } return null; }
public Region(String _Name, int _PosX, int _PosY, RegionEnum _RegionEnum, World.World _ParentWorld) { this.Name = _Name; this.Position = new Vector3(_PosX, _PosY, 0); this.Size = new Vector3(regionSizeX, regionSizeY, 0); this.Bounds = new Rectangle((int)this.Position.X, (int)this.Position.Y, (int)(regionSizeX * Chunk.Chunk.chunkSizeX * Block.Block.BlockSize - 1), (int)(regionSizeX * Chunk.Chunk.chunkSizeY * Block.Block.BlockSize - 1)); chunks = new Chunk.Chunk[regionSizeX * regionSizeY]; this.regionEnum = _RegionEnum; this.Parent = _ParentWorld; if (Configuration.Configuration.isHost) { } else { this.requestFromServer(); } }
private Region generateRegionGrassland(String _Name, int _PosX, int _PosY, World _ParentWorld) { Region var_Result; var_Result = new Region(_Name, _PosX, _PosY, RegionEnum.Grassland, _ParentWorld); //FarmFactory.farmFactory.generateFarms(var_Result, 1, 0); Logger.Logger.LogInfo("Region " + var_Result.Name + " wurde erstellt!"); return var_Result; }
private Region generateRegionSnowland(String _Name, int _PosX, int _PosY, World _ParentWorld) { Region var_Result; var_Result = new Region(_Name, _PosX, _PosY, RegionEnum.Snowland, _ParentWorld); Logger.Logger.LogInfo("Region " + var_Result.Name + " wurde erstellt!"); return var_Result; }
public void Decode(NetIncomingMessage im) { this.MessageTime = im.ReadDouble(); this.World = Utility.Serializer.DeserializeObjectFromString<World>(im.ReadString()); }
public UpdateWorldMessage(World _World) { this.MessageTime = NetTime.Now; this.World = _World; }