Esempio n. 1
0
 public HeightmapController(ITerrainService terrainService, IFaultHeightmapGenerator faultHeightmapGenerator, IDiamondSquareGenerator diamondSquareGenerator, IOpenSimplexGenerator openSimplexGenerator)
 {
     this.terrainService          = terrainService;
     this.faultHeightmapGenerator = faultHeightmapGenerator;
     this.diamondSquareGenerator  = diamondSquareGenerator;
     this.openSimplexGenerator    = openSimplexGenerator;
 }
Esempio n. 2
0
        public GameController(
            Game game,
            ICollisionDetectionService collisionDetectionService,
            IPlayerService playerService,
            IEnemyService enemyService,
            IInputService inputService,
            IHeadUpDisplayService headUpDisplayService,
            ITerrainService terrainService,
            IAudioService audioService)
            : base(game)
        {
            this.game = game;

            this.collisionDetectionService = collisionDetectionService;
            this.playerService = playerService;
            this.enemyService = enemyService;
            this.inputService = inputService;
            this.headUpDisplayService = headUpDisplayService;
            this.terrainService = terrainService;
            this.audioService = audioService;

            this.inputService.AnalogPauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };
            this.inputService.PauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };

            this.fadeEffect = "FadeIn";
        }
Esempio n. 3
0
 public PlayerService(Game game, IInputService inputService, IAudioService audioService, IPlayerFactory playerFactory, ITerrainService terrainService)
     : base(game)
 {
     this.inputService = inputService;
     this.audioService = audioService;
     this.playerFactory = playerFactory;
     this.terrainService = terrainService;
 }
Esempio n. 4
0
        /// <summary>
        /// Unity Start function called when the gameobject instantiates
        /// </summary>
        public void Start()
        {
            m_lineMaterial                  = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended"));
            m_lineMaterial.hideFlags        = HideFlags.HideAndDontSave;
            m_lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;

            m_terrainService = TinyIoCContainer.Current.Resolve <ITerrainService>();
            m_terrainService.SetDimensions(m_width, m_height);
        }
Esempio n. 5
0
        /// <summary>
        /// Unity function called after instantiating the gameobject
        /// </summary>
        public void Start()
        {
            m_lineMaterial                  = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended"));
            m_lineMaterial.hideFlags        = HideFlags.HideAndDontSave;
            m_lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;

            m_brushTypes     = Enum.GetValues(typeof(Brush)).Cast <Brush>();
            m_logging        = TinyIoCContainer.Current.Resolve <ILoggingService>();
            m_terrainService = TinyIoCContainer.Current.Resolve <ITerrainService>();
        }
 public CollisionDetectionService(
     Game game,
     IPlayerService playerService,
     IEnemyService enemyService,
     ITerrainService terrainService)
     : base(game)
 {
     this.playerService = playerService;
     this.enemyService = enemyService;
     this.terrainService = terrainService;
 }
        protected override void Start()
        {
            base.Start();
            MoveProvaider = Container.Resolve<IFigureMoveProvaider>();
            base.Start();
            if (!isServer)
            {
                MoveProvaider.Initialize(this, _currentTerrainBehaviour);
                return;
            }

            _terrainService = Container.Resolve<ITerrainService>();
            _currentTerrainBehaviour = _terrainService.GetTerrainBehaviour(_random.Next(1, 5), _random.Next(1, 5));
            MoveProvaider.Initialize(this, _currentTerrainBehaviour);
        }
Esempio n. 8
0
 public BorderService(ITerrainService terrainService, IBuidlerTownStrategy buidlerTownStrategy)
 {
     _terrainService = terrainService;
     _buidlerTownStrategy = buidlerTownStrategy;
 }
Esempio n. 9
0
        private void ComposeServices()
        {
            this.terrainService = new TerrainService(
                this);

            this.headUpDisplayService = new HeadUpDisplayService(
                this);

            this.audioService = new AudioService(
                this);

            this.enemyFactory = new EnemyFactory(
                this,
                terrainService);

            this.enemyService = new EnemyService(
                this,
                enemyFactory);

            this.playerFactory = new PlayerFactory(
                this);

            this.inputService = new InputService(
                this);

            this.playerService = new PlayerService(
                this,
                inputService,
                audioService,
                playerFactory,
                terrainService);

            this.collisionDetectionService = new CollisionDetectionService(
                this,
                playerService,
                enemyService,
                terrainService);

            this.gameController = new GameController(
                this,
                collisionDetectionService,
                playerService,
                enemyService,
                inputService,
                headUpDisplayService,
                terrainService,
                audioService);

            try
            {
                var consoleAssembly = Assembly.Load("SpaceFighter.Console");
                var consoleServiceType = consoleAssembly.GetType("SpaceFighter.Console.ConsoleService");
                var consoleService = Activator.CreateInstance(consoleServiceType, this);

                this.Components.Add(consoleService as IGameComponent);
            }
            catch(FileNotFoundException)
            {
                // No console support available
            }
        }
 public FigureMoveProvaider(ITerrainService terrainService)
 {
     _terrainService = terrainService;
 }