Ejemplo n.º 1
0
        public StrategyGameRenderingFactory(GameRenderingConfig renderingConfig,
                                            StrategyGameData gameData,
                                            StrategyGameTileSet <TTile> tileSet,
                                            IDerivedTileProducer <TTile, TTexture> tileProducer,
                                            ITextureOperations <TTexture, TColor> textureOperations)
        {
            this.tileProducer      = tileProducer;
            this.textureOperations = textureOperations;
            RenderingConfig        = renderingConfig ?? throw new ArgumentNullException(nameof(RenderingConfig));
            GameData = gameData ?? throw new ArgumentNullException(nameof(GameData));
            TileSet  = tileSet ?? throw new ArgumentNullException(nameof(TileSet));

            var r = new BasicTileRegistry <TTile>();

            foreach (var t in tileSet.Textures.Tiles)
            {
                r.Add(t.Tag, t);
            }

            Tiles = r;

            cellRendering = new TagSetRenderingFactory(this);
            boolRendering = new BoolRenderingFactory(this);
            RenderControl = new RendererControl(tileSet.TileSize, renderingConfig.RenderType);
            EnableCache   = true;
        }
Ejemplo n.º 2
0
        protected CityBarRenderingFactoryBase(GameRenderingConfig renderingConfig,
                                              StrategyGameData gameData,
                                              IntDimension tileSize)
        {
            RenderingConfig = renderingConfig ?? throw new ArgumentNullException(nameof(RenderingConfig));
            GameData        = gameData ?? throw new ArgumentNullException(nameof(GameData));

            RenderControl = new RendererControl(tileSize, renderingConfig.RenderType);
        }
Ejemplo n.º 3
0
        public GameRendering(Game game,
                             GameRenderingConfig config,
                             RendererControl renderControl,
                             IPlotter gridPlotter) : base(game)
        {
            this.gridPlotter        = gridPlotter ?? throw new ArgumentNullException(nameof(gridPlotter));
            this.config             = config ?? throw new ArgumentNullException(nameof(config));
            config.PropertyChanged += OnRenderingConfigPropertyChanged;

            RenderControl = renderControl ?? throw new ArgumentNullException(nameof(renderControl));
            RenderControl.PropertyChanged += OnRenderPropertyChanged;

            if (config.RenderType != renderControl.ActiveRenderType)
            {
                throw new ArgumentException("RenderConfig render type and renderControl render type must match.");
            }

            RotationSteps = 0;
            CenterPointInMapCoordinates = new MapCoordinate(0, 0);

            plotters = new List <IPlotOperation>();
        }
Ejemplo n.º 4
0
 public GameRendering(Game game,
                      GameRenderingConfig config,
                      RendererControl renderControl) : this(game, config, renderControl, config.CreatePlotter())
 {
 }
Ejemplo n.º 5
0
 public Settings(RendererControl _MainFormrender)
 {
     InitializeComponent();
     render = _MainFormrender;
 }