示例#1
0
 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;
 }
示例#2
0
        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();
            }
        }
示例#3
0
        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;
        }
示例#4
0
        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;
        }
示例#5
0
 public void Decode(NetIncomingMessage im)
 {
     this.MessageTime = im.ReadDouble();
     this.World = Utility.Serializer.DeserializeObjectFromString<World>(im.ReadString());
 }
示例#6
0
 public UpdateWorldMessage(World _World)
 {
     this.MessageTime = NetTime.Now;
     this.World = _World;
 }