public MouseCursorRenderer(INativeGraphicsManager nativeGraphicsManager,
                                   ICharacterProvider characterProvider,
                                   IRenderOffsetCalculator renderOffsetCalculator,
                                   IMapCellStateProvider mapCellStateProvider,
                                   IItemStringService itemStringService,
                                   IEIFFileProvider eifFileProvider,
                                   ICurrentMapProvider currentMapProvider,
                                   IGraphicsDeviceProvider graphicsDeviceProvider,
                                   IMapInteractionController mapInteractionController)
        {
            _mouseCursorTexture       = nativeGraphicsManager.TextureFromResource(GFXTypes.PostLoginUI, 24, true);
            _characterProvider        = characterProvider;
            _renderOffsetCalculator   = renderOffsetCalculator;
            _mapCellStateProvider     = mapCellStateProvider;
            _itemStringService        = itemStringService;
            _eifFileProvider          = eifFileProvider;
            _currentMapProvider       = currentMapProvider;
            _mapInteractionController = mapInteractionController;

            SingleCursorFrameArea = new Rectangle(0, 0,
                                                  _mouseCursorTexture.Width / (int)CursorIndex.NumberOfFramesInSheet,
                                                  _mouseCursorTexture.Height);
            _drawArea = SingleCursorFrameArea;

            _mapItemText = new XNALabel(Constants.FontSize08pt75)
            {
                Visible   = false,
                Text      = string.Empty,
                ForeColor = Color.White,
                AutoSize  = false,
                DrawOrder = 10 //todo: make a better provider for draw orders (see also HudControlsFactory)
            };

            _spriteBatch = new SpriteBatch(graphicsDeviceProvider.GraphicsDevice);
        }
 public OverlayLayerRenderer(INativeGraphicsManager nativeGraphicsManager,
                             ICurrentMapProvider currentMapProvider,
                             ICharacterProvider characterProvider,
                             IRenderOffsetCalculator renderOffsetCalculator)
     : base(characterProvider, renderOffsetCalculator)
 {
     _nativeGraphicsManager = nativeGraphicsManager;
     _currentMapProvider    = currentMapProvider;
 }
Beispiel #3
0
 public MapItemLayerRenderer(ICharacterProvider characterProvider,
                             IRenderOffsetCalculator renderOffsetCalculator,
                             ICurrentMapStateProvider currentMapStateProvider,
                             IMapItemGraphicProvider mapItemGraphicProvider)
     : base(characterProvider, renderOffsetCalculator)
 {
     _currentMapStateProvider = currentMapStateProvider;
     _mapItemGraphicProvider  = mapItemGraphicProvider;
 }
Beispiel #4
0
 public NPCEntityRenderer(ICharacterProvider characterProvider,
                          IRenderOffsetCalculator renderOffsetCalculator,
                          INPCRendererProvider npcRendererProvider,
                          IChatBubbleProvider chatBubbleProvider)
     : base(characterProvider, renderOffsetCalculator)
 {
     _npcRendererProvider = npcRendererProvider;
     _chatBubbleProvider  = chatBubbleProvider;
 }
Beispiel #5
0
 public ShadowLayerRenderer(INativeGraphicsManager nativeGraphicsManager,
                            ICurrentMapProvider currentMapProvider,
                            ICharacterProvider characterProvider,
                            IRenderOffsetCalculator renderOffsetCalculator,
                            IConfigurationProvider configurationProvider)
     : base(characterProvider, renderOffsetCalculator)
 {
     _nativeGraphicsManager = nativeGraphicsManager;
     _currentMapProvider    = currentMapProvider;
     _configurationProvider = configurationProvider;
 }
 public OtherCharacterEntityRenderer(ICharacterProvider characterProvider,
                                     ICharacterRendererProvider characterRendererProvider,
                                     IChatBubbleProvider chatBubbleProvider,
                                     ICharacterStateCache characterStateCache,
                                     IRenderOffsetCalculator renderOffsetCalculator)
     : base(characterProvider, renderOffsetCalculator)
 {
     _characterRendererProvider = characterRendererProvider;
     _chatBubbleProvider        = chatBubbleProvider;
     _characterStateCache       = characterStateCache;
 }
 public NPCRendererFactory(IEndlessGameProvider endlessGameProvider,
                           ICharacterRendererProvider characterRendererProvider,
                           IENFFileProvider enfFileProvider,
                           INPCSpriteSheet npcSpriteSheet,
                           IRenderOffsetCalculator renderOffsetCalculator)
 {
     _endlessGameProvider       = endlessGameProvider;
     _characterRendererProvider = characterRendererProvider;
     _enfFileProvider           = enfFileProvider;
     _npcSpriteSheet            = npcSpriteSheet;
     _renderOffsetCalculator    = renderOffsetCalculator;
 }
 public CharacterRendererFactory(IEndlessGameProvider gameProvider,
                                 IRenderTargetFactory renderTargetFactory,
                                 ICharacterProvider characterProvider,
                                 IRenderOffsetCalculator renderOffsetCalculator,
                                 ICharacterPropertyRendererBuilder characterPropertyRendererBuilder,
                                 ICharacterTextures characterTextures,
                                 ICharacterSpriteCalculator characterSpriteCalculator)
 {
     _gameProvider                     = gameProvider;
     _renderTargetFactory              = renderTargetFactory;
     _characterProvider                = characterProvider;
     _renderOffsetCalculator           = renderOffsetCalculator;
     _characterPropertyRendererBuilder = characterPropertyRendererBuilder;
     _characterTextures                = characterTextures;
     _characterSpriteCalculator        = characterSpriteCalculator;
 }
Beispiel #9
0
 public CharacterRenderer(Game game,
                          IRenderTargetFactory renderTargetFactory,
                          ICharacterProvider characterProvider,
                          IRenderOffsetCalculator renderOffsetCalculator,
                          ICharacterPropertyRendererBuilder characterPropertyRendererBuilder,
                          ICharacterTextures characterTextures,
                          ICharacterSpriteCalculator characterSpriteCalculator,
                          ICharacterRenderProperties renderProperties)
     : base(game)
 {
     _renderTargetFactory              = renderTargetFactory;
     _characterProvider                = characterProvider;
     _renderOffsetCalculator           = renderOffsetCalculator;
     _characterPropertyRendererBuilder = characterPropertyRendererBuilder;
     _characterTextures                = characterTextures;
     _characterSpriteCalculator        = characterSpriteCalculator;
     RenderProperties = renderProperties;
 }
 public MouseCursorRendererFactory(INativeGraphicsManager nativeGraphicsManager,
                                   ICharacterProvider characterProvider,
                                   IRenderOffsetCalculator renderOffsetCalculator,
                                   IMapCellStateProvider mapCellStateProvider,
                                   IItemStringService itemStringService,
                                   IEIFFileProvider eifFileProvider,
                                   ICurrentMapProvider currentMapProvider,
                                   IGraphicsDeviceProvider graphicsDeviceProvider,
                                   IMapInteractionController mapInteractionController)
 {
     _nativeGraphicsManager    = nativeGraphicsManager;
     _characterProvider        = characterProvider;
     _renderOffsetCalculator   = renderOffsetCalculator;
     _mapCellStateProvider     = mapCellStateProvider;
     _itemStringService        = itemStringService;
     _eifFileProvider          = eifFileProvider;
     _currentMapProvider       = currentMapProvider;
     _graphicsDeviceProvider   = graphicsDeviceProvider;
     _mapInteractionController = mapInteractionController;
 }
Beispiel #11
0
        public MainCharacterEntityRenderer(ICharacterProvider characterProvider,
                                           ICharacterRendererProvider characterRendererProvider,
                                           IChatBubbleProvider chatBubbleProvider,
                                           IRenderOffsetCalculator renderOffsetCalculator)
            : base(characterProvider, renderOffsetCalculator)
        {
            _characterRendererProvider = characterRendererProvider;
            _chatBubbleProvider        = chatBubbleProvider;

            _playerBlend = new BlendState
            {
                BlendFactor = new Color(255, 255, 255, 64),

                AlphaSourceBlend      = Blend.One,
                AlphaDestinationBlend = Blend.One,
                AlphaBlendFunction    = BlendFunction.Add,

                ColorSourceBlend      = Blend.BlendFactor,
                ColorDestinationBlend = Blend.One
            };
        }
Beispiel #12
0
        public NPCRenderer(IEndlessGameProvider endlessGameProvider,
                           ICharacterRendererProvider characterRendererProvider,
                           IENFFileProvider enfFileProvider,
                           INPCSpriteSheet npcSpriteSheet,
                           IRenderOffsetCalculator renderOffsetCalculator,
                           INPC initialNPC)
            : base((Game)endlessGameProvider.Game)
        {
            NPC = initialNPC;

            _characterRendererProvider = characterRendererProvider;
            _enfFileProvider           = enfFileProvider;
            _npcSpriteSheet            = npcSpriteSheet;
            _renderOffsetCalculator    = renderOffsetCalculator;

            _baseTextureFrameRectangle = GetStandingFrameRectangle();
            _readonlyTopPixel          = GetTopPixel();

            _hasStandingAnimation  = GetHasStandingAnimation();
            _lastStandingAnimation = DateTime.Now;
            _fadeAwayAlpha         = 255;
        }
 protected BaseMapEntityRenderer(ICharacterProvider characterProvider,
                                 IRenderOffsetCalculator renderOffsetCalculator)
 {
     _characterProvider      = characterProvider;
     _renderOffsetCalculator = renderOffsetCalculator;
 }
        public MapEntityRendererProvider(INativeGraphicsManager nativeGraphicsManager,
                                         ICurrentMapProvider currentMapProvider,
                                         ICharacterProvider characterProvider,
                                         ICurrentMapStateProvider currentMapStateProvider,
                                         IMapItemGraphicProvider mapItemGraphicProvider,
                                         IRenderOffsetCalculator renderOffsetCalculator,
                                         IConfigurationProvider configurationProvider,
                                         ICharacterRendererProvider characterRendererProvider,
                                         INPCRendererProvider npcRendererProvider,
                                         IChatBubbleProvider chatBubbleProvider,
                                         ICharacterStateCache characterStateCache)
        {
            MapBaseRenderers = new List <IMapEntityRenderer>
            {
                new GroundLayerRenderer(nativeGraphicsManager,
                                        currentMapProvider,
                                        characterProvider,
                                        renderOffsetCalculator),
                new MapItemLayerRenderer(characterProvider,
                                         renderOffsetCalculator,
                                         currentMapStateProvider,
                                         mapItemGraphicProvider)
            };

            MapEntityRenderers = new List <IMapEntityRenderer>
            {
                new OverlayLayerRenderer(nativeGraphicsManager,
                                         currentMapProvider,
                                         characterProvider,
                                         renderOffsetCalculator),
                new ShadowLayerRenderer(nativeGraphicsManager,
                                        currentMapProvider,
                                        characterProvider,
                                        renderOffsetCalculator,
                                        configurationProvider),
                new WallLayerRenderer(nativeGraphicsManager,
                                      currentMapProvider,
                                      characterProvider,
                                      renderOffsetCalculator,
                                      currentMapStateProvider),
                new MapObjectLayerRenderer(nativeGraphicsManager,
                                           currentMapProvider,
                                           characterProvider,
                                           renderOffsetCalculator),
                new OtherCharacterEntityRenderer(characterProvider,
                                                 characterRendererProvider,
                                                 chatBubbleProvider,
                                                 characterStateCache,
                                                 renderOffsetCalculator),
                new NPCEntityRenderer(characterProvider,
                                      renderOffsetCalculator,
                                      npcRendererProvider,
                                      chatBubbleProvider),
                new RoofLayerRenderer(nativeGraphicsManager,
                                      currentMapProvider,
                                      characterProvider,
                                      renderOffsetCalculator),
                new UnknownLayerRenderer(nativeGraphicsManager,
                                         currentMapProvider,
                                         characterProvider,
                                         renderOffsetCalculator),
                new OnTopLayerRenderer(nativeGraphicsManager,
                                       currentMapProvider,
                                       characterProvider,
                                       renderOffsetCalculator),
                new MainCharacterEntityRenderer(characterProvider,
                                                characterRendererProvider,
                                                chatBubbleProvider,
                                                renderOffsetCalculator)
            };
        }