Esempio n. 1
0
        /// <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);
            }
        }
Esempio n. 2
0
        public JsonResult Palet([FromBody] Palet item)
        {
            switch (Request.Method.ToString())
            {
            case "POST":
                return(Json(controladorPalet.AltaPalet(item), new Newtonsoft.Json.JsonSerializerSettings()));

            case "DELETE":
                return(Json(controladorPalet.BajaPalet(item), new Newtonsoft.Json.JsonSerializerSettings()));
            }

            return(Json("Accion Http Desconocida", new Newtonsoft.Json.JsonSerializerSettings()));
        }
Esempio n. 3
0
        public void Initialize()
        {
            _playerInformations = new PlayerInformation("Joueur 1");
            _levelHUD           = new LevelHUD(this, _playerInformations);
            _palet              = new Palet(this);
            _balle              = new Balle(this);
            _balle.balleMissed += this.BalleMissed_Event;
            _bricksManager      = new BricksManager(this);

            removeSpriteIndex = -1;
            canPlay           = true;
            retry             = false;

            allSprites.Clear();

            _levelHUD.Initialize();
            _palet.Initialize();
            _balle.Initialize();
            _bricksManager.Initialize();

            // Le palet est en première position dans la collection
            // La balle à la deuxième position, cela permet de ne pas itérer toute la collection
            // pour trouver une collision
            allSprites.Insert(0, _palet);
            allSprites.Insert(1, _balle);

            foreach (Brick b in _bricksManager.ListBricks)
            {
                b.brickDestroyed += this.BrickAsDestroyed_Event;
                allSprites.Add(b);
            }

            foreach (Sprite s in allSprites)
            {
                s.Scale = spriteScale;
            }
        }
Esempio n. 4
0
 public bool BajaPalet(Palet palet)
 {
     return(true);
 }
Esempio n. 5
0
 public bool AltaPalet(Palet palet)
 {
     return(true);
 }
Esempio n. 6
0
        public bool AltaPalet(Palet unPalet)
        {
            bool exito = false;

            return(exito);
        }
Esempio n. 7
0
 public void SetPalet(Palet pPalet)
 {
     palet = pPalet;
 }