Exemplo n.º 1
0
        public Scene(
            Guid id,
            IEnumerable <ForExternalUse.Generation.ObjectInterfaces.IPlayer> players,
            ForExternalUse.Generation.ISceneGenerator generator,
            ForExternalUse.INativeManager nativeManager,
            ForExternalUse.IVarManager varManager,
            int seed,
            int moveMilliseconds)
        {
            this.moveMilliseconds = moveMilliseconds;
            this.IdsCounter       = 1;
            this.IsActive         = true;
            this.Id            = id;
            this.PassedTime    = 0;
            this.GameRandom    = new Random(seed);
            this.NativeManager = (INativeManager)nativeManager;
            this.VarManager    = (IVarManager)varManager;
            ISceneGenerator tempGenerator = (ISceneGenerator)generator;

            this.WinCondition       = tempGenerator.WinCondition;
            this.DefeatCondition    = tempGenerator.DefeatCondition;
            this.EnemyActorsPrefix  = string.Empty;
            this.players            = new List <Player>();
            this.Actors             = new List <Actor>();
            this.Decorations        = new List <ActiveDecoration>();
            this.SpecEffects        = new List <SpecEffect>();
            this.DeletedActors      = new List <Actor>();
            this.DeletedDecorations = new List <ActiveDecoration>();
            this.DeletedEffects     = new List <SpecEffect>();
            tempGenerator.GenerateNewScene(this, players, unchecked (seed * id.GetHashCode()));
        }
Exemplo n.º 2
0
        public static IScene CreateNewScene(
            Guid id,
            IEnumerable <Generation.ObjectInterfaces.IPlayer> players,
            ISceneGenerator generator,
            INativeManager nativeManager,
            IVarManager varManager,
            int seed,
            int moveTime,
            EventHandler <ISyncEventArgs> eventHandler)
        {
            Scene scene = new Scene(id, players, generator, nativeManager, varManager, seed, moveTime);

            scene.ReturnAction += eventHandler;
            scene.StartGame();
            return(scene);
        }
Exemplo n.º 3
0
 public LoggingSceneGenerator(ISceneGenerator sceneGenerator)
 {
     this.sceneGenerator = sceneGenerator;
 }