public TowerBase GetTower(GameLevelTime time, GameLevel gameLevel, TowerSettings towerSettings, GraphicsTracker graphicsTracker)
 {
     return(_container
            .With("gameLevelTime").EqualTo(time)
            .With("gameLevel").EqualTo(gameLevel)
            .With("settings").EqualTo(towerSettings)
            .With("graphicsTracker").EqualTo(graphicsTracker)
            .GetInstance <TowerBase>());
 }
예제 #2
0
        public TowerBase(TowerSettings settings, GameLevelTime gameLevelTime,
                         GameLevel gameLevel, GraphicsTracker graphicsTracker, SpriteSheets spriteSheets, InputManager inputManager)
        {
            _shootLimiter    = new GameLevelActionLimiter(gameLevelTime, settings.ShootFrequency);
            Settings         = settings;
            _gameLevel       = gameLevel;
            _graphicsTracker = graphicsTracker;
            _inputManager    = inputManager;

            // TODO: Create sprite without direction.
            var spr = new SpriteWithDirections
            {
                Sprites = new Dictionary <SpriteDirectionEnum, SpriteDetails>
                {
                    { SpriteDirectionEnum.BottomLeft, spriteSheets.GetSprite(SpriteEnum.Tower) },
                    { SpriteDirectionEnum.BottomRight, spriteSheets.GetSprite(SpriteEnum.Tower) },
                    { SpriteDirectionEnum.TopLeft, spriteSheets.GetSprite(SpriteEnum.Tower) },
                    { SpriteDirectionEnum.TopRight, spriteSheets.GetSprite(SpriteEnum.Tower) }
                }
            };

            _sprite = new SpriteWithDirectionsRenderer(spr);
        }