Exemple #1
0
        public GeneratorProcess Generate(Config config)
        {
            this.sizeXbits = config.worldSize.worldSizeBitsX;
            this.sizeYbits = config.worldSize.worldSizeBitsY;
            this.sizeZbits = config.worldSize.worldSizeBitsZ;

            sizeX = 1 << sizeXbits;
            sizeY = 1 << sizeYbits;
            sizeZ = 1 << sizeZbits;

            gameplay = config.gameplay.gameplay;
            gameplay.Init(this);
			
			tileManager.Create(config.tileDefinitions, sizeXbits, sizeYbits, sizeZbits);
			itemManager.Create(config.itemDefinitions);
			
            avatarManager.Create(config.avatarDefinitions);

			sectorManager.Create();
			dayCycleManager.Create(config.dayInfo);

            configSurroundings = config.worldGenerator.surroundings;
            configExtraMaterials = config.extraMaterials;

            MemoryStream ms = new MemoryStream();
            BinaryWriter bw = new BinaryWriter(ms);

            return gameplay.Generate(config);
		}
 public GameplayDefinition(string name, string description, BaseGameplay gameplay, bool hasCustomGenerator)
 {
     this.id = gameplay.Id;
     this.name = name;
     this.description = description;
     this.gameplay = gameplay;
     this.hasCustomGenerator = hasCustomGenerator;
 }
 public GameplayDefinition(string name, string description, BaseGameplay gameplay, bool hasCustomGenerator)
 {
     this.id                 = gameplay.Id;
     this.name               = name;
     this.description        = description;
     this.gameplay           = gameplay;
     this.hasCustomGenerator = hasCustomGenerator;
 }
 public MultiplayerServerGameplay(BaseGameplay baseGameplay, bool createPlayer) :
     base("multiplayerServer")
 {
     this.baseGameplay = baseGameplay;
     this.createPlayer = createPlayer;
 }
 public MultiplayerServerGameplay(BaseGameplay baseGameplay, bool createPlayer) :
     base("multiplayerServer")
 {
     this.baseGameplay = baseGameplay;
     this.createPlayer = createPlayer;
 }
Exemple #6
0
        public void Clear()
        {
            stats = null;
			
			sectorManager.Clear();
			sectorManager = null;
			
			tileManager.Clear();
			tileManager = null;
			
			itemManager.Clear();
			itemManager = null;
			
			avatarManager.Clear();
			avatarManager = null;
			
			dayCycleManager.Clear();
			dayCycleManager = null;

            gameplay.Clear();
            gameplay = null;
		}
Exemple #7
0
        private void Load(BinaryReader br, bool isMultiplayer)
        {
            this.sizeXbits = br.ReadInt32();
            this.sizeYbits = br.ReadInt32();
            this.sizeZbits = br.ReadInt32();

            sizeX = 1 << sizeXbits;
            sizeY = 1 << sizeYbits;
            sizeZ = 1 << sizeZbits;

            if (isMultiplayer == false)
            {
                string gameplayId = br.ReadString();

                gameplay = GameplayFactory.GetGameplayById(gameplayId);
                gameplay.Init(this);
                gameplay.Load(br);
            }
            else
            {
                gameplay.Init(this);
            }

            configSurroundings = new ConfigSurroundings();
            configSurroundings.Load(br);
        }