Exemple #1
0
 public void Initialize(ISceneSettings settings)
 {
     Root          = Rules.CreateWorld(this, settings);
     DrawerFactory = new DrawerFactory(Root);
     PhysicalManager.InitializeEngine(PhysicalEngines.Farseer, Root);
     Logger = new ReplayLogger(Root, 0.1);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AssetEditor" /> class.
        /// </summary>
        /// <param name="assetManagerFactory">The asset manager factory.</param>
        /// <param name="viewFactory">The view factory.</param>
        /// <param name="drawerFactory">The drawer factory.</param>
        /// <param name="paletFactory">The palet factory.</param>
        /// <param name="previewBarFactory">The preview bar factory.</param>
        /// <param name="fileLocationProvider">The file location provider.</param>
        public AssetEditor(
            AssetManagerFactory assetManagerFactory,
            ViewFactory viewFactory,
            DrawerFactory drawerFactory,
            PaletFactory paletFactory,
            PreviewBarFactory previewBarFactory,
            FileLocationProvider fileLocationProvider)
        {
            this.InitializeComponent();
            this.viewFactory          = viewFactory;
            this.drawerFactory        = drawerFactory;
            this.paletFactory         = paletFactory;
            this.previewBarFactory    = previewBarFactory;
            this.fileLocationProvider = fileLocationProvider;
            this.assetManager         = assetManagerFactory.Get(this.fileLocationProvider.AssetFile, false);
            this.palet      = this.paletFactory.Get(this.PaletPanel);
            this.drawer     = this.drawerFactory.Get(this.DrawerPanel);
            this.previewBar = this.previewBarFactory.Get(this.PreviewBar);

            this.ButtonSize.Value = Settings.Default.ZoomLevel;

            // Event handler setup must precede loading assets but happen after the asset manager is created
            this.SetupEventHandlers();

            // Load assets and trigger events.
            this.assetManager.LoadAssets();

            if (this.assetManager.CurrentAsset != null)
            {
                this.previewBar.Draw(this.assetManager.CurrentAsset.Shapes);
            }
        }
Exemple #3
0
 private static Drawer BuildDrawer(GridModel grid, GridStatus status)
 {
     try { return(DrawerFactory.CreateDrawer(grid, status)); }
     catch (Exception e)
     {
         string msg = String.Format("Building drawer for grid '{0}' failed!", grid.Id);
         throw new Exception(msg, e);
     }
 }
        public DrawingModule(IDrawingModuleSetup setup)
        {
            if (setup == null)
            {
                throw new Exception("Module setup cannot be null");
            }

            lines              = new List <Line.Line>();
            this.setup         = setup;
            this.drawerFactory = new DrawerFactory(setup.InputReaderFactory);
        }
Exemple #5
0
        public CVARCEngineCamera(Body body, DrawerFactory factory, RobotCameraSettings settings)
        {
            Settings   = settings;
            this.robot = body;
            Angle viewAngle = Settings.ViewAngle;

            _camera = new FirstPersonCamera(this.robot, Settings.Location,
                                            viewAngle, DefaultWidth / (double)DefaultHeight);
            _drawer = new OffscreenDirectXDrawer(factory.GetDirectXScene(), DefaultWidth,
                                                 DefaultHeight);
        }
Exemple #6
0
        Captcha(bool createBuilder, Config config)
        {
            // the createBuilder is false when the object has been created from the builder
            // and true when a public constructor is used instead
            if (createBuilder)
            {
                if (config == null)
                {
                    throw new ArgumentNullException("config", "Configuration object can't be null");
                }

                new Builder(this)
                .Background(BackgroundFactory.Create(config))
                .Keygen(KeygenFactory.Create(config))
                .Drawer(DrawerFactory.Create(config))
                .Filters(FilterFactory.Create(config))
                .Build();
            }
        }
Exemple #7
0
			public void Setup()
			{
				_drawerFactory= new DrawerFactory(_rootBody);
			}
Exemple #8
0
 public void Setup()
 {
     _drawerFactory = new DrawerFactory(_rootBody);
 }