public async Task ActionBegin(ActionEventArgs <TipoCelda> args)
        {
            if (args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
            {
                HttpResponseMessage response;
                bool      found = tipoceldas.Any(p => p.CG_TIPOCELDA == args.Data.CG_TIPOCELDA);
                TipoCelda ur    = new TipoCelda();

                if (!found)
                {
                    args.Data.CG_CIA  = 1;
                    args.Data.USUARIO = "User";
                    response          = await Http.PostAsJsonAsync("api/TipoCelda", args.Data);

                    args.Data.CG_TIPOCELDA = tipoceldas.Max(s => s.CG_TIPOCELDA) + 1;
                }
                else
                {
                    response = await Http.PutAsJsonAsync($"api/TipoCelda/{args.Data.CG_TIPOCELDA}", args.Data);
                }

                if (response.StatusCode == System.Net.HttpStatusCode.Created)
                {
                }
            }

            if (args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
            {
                await EliminarTipoDeCelda(args);
            }
        }
Exemple #2
0
        public Celda(short _id, bool esta_activa, TipoCelda _tipo, bool _es_linea_vision, byte _nivel, byte _slope, short _objeto_interactivo_id, short _layer_object_1_num, short _layer_object_2_num, Map map)
        {
            id     = _id;
            activa = esta_activa;
            tipo   = _tipo;

            layer_object_1_num = _layer_object_1_num;
            layer_object_2_num = _layer_object_2_num;

            es_linea_vision    = _es_linea_vision;
            layer_ground_nivel = _nivel;
            layer_ground_slope = _slope;

            if (_objeto_interactivo_id != -1)
            {
                objeto_interactivo = new ObjetoInteractivo(_objeto_interactivo_id, this);
                map.interactivos.TryAdd(id, objeto_interactivo);
            }

            byte mapa_anchura = map.anchura;
            int  _loc5        = id / ((mapa_anchura * 2) - 1);
            int  _loc6        = id - (_loc5 * ((mapa_anchura * 2) - 1));
            int  _loc7        = _loc6 % mapa_anchura;

            y = _loc5 - _loc7;
            x = (id - ((mapa_anchura - 1) * y)) / mapa_anchura;
        }
        // Token: 0x0600025D RID: 605 RVA: 0x0000A170 File Offset: 0x00008570
        public Celda(short _id, bool esta_activa, TipoCelda _tipo, bool _es_linea_vision, byte _nivel, byte _slope, short _objeto_interactivo_id, short _layer_object_1_num, short _layer_object_2_num, Mapa _mapa)
        {
            this.id                 = _id;
            this.activa             = esta_activa;
            this.tipo               = _tipo;
            this.layer_object_1_num = _layer_object_1_num;
            this.layer_object_2_num = _layer_object_2_num;
            this.es_linea_vision    = _es_linea_vision;
            this.layer_ground_nivel = _nivel;
            this.layer_ground_slope = _slope;
            bool flag = _objeto_interactivo_id != -1;

            if (flag)
            {
                this.objeto_interactivo = new ObjetoInteractivo(_objeto_interactivo_id, this);
                _mapa.interactivos.TryAdd((int)this.id, this.objeto_interactivo);
            }
            byte anchura = _mapa.anchura;
            int  num     = (int)(this.id / (short)(anchura * 2 - 1));
            int  num2    = (int)this.id - num * (int)(anchura * 2 - 1);
            int  num3    = num2 % (int)anchura;

            this.y = num - num3;
            this.x = ((int)this.id - (int)(anchura - 1) * this.y) / (int)anchura;
        }
Exemple #4
0
 public Celda(int fil, int col, int valor_int)
 {
     f = fil;
     c = col;
     ResetValores();
     tipoCelda   = TipoCelda.CeldaEntero;
     this.ivalor = valor_int;
 }
Exemple #5
0
 public Celda(int fil, int col, DateTime valor_fecha)
 {
     f         = fil;
     c         = col;
     tipoCelda = TipoCelda.CeldaFecha;
     ResetValores();
     fvalor = valor_fecha;
 }
Exemple #6
0
 public Celda(int fil, int col, String valor_stri)
 {
     f         = fil;
     c         = col;
     tipoCelda = TipoCelda.CeldaString;
     ResetValores();
     svalor = valor_stri;
 }
Exemple #7
0
 public Celda(int fil, int col, double valor_doub)
 {
     f = fil;
     c = col;
     ResetValores();
     tipoCelda = TipoCelda.CeldaDoble;
     dvalor    = valor_doub;
 }
        public async Task ClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
        {
            if (args.Item.Text == "Copy")
            {
                if (this.Grid.SelectedRecords.Count > 0)
                {
                    foreach (TipoCelda selectedRecord in this.Grid.SelectedRecords)
                    {
                        bool isConfirmed = await JsRuntime.InvokeAsync <bool>("confirm", "Seguro de que desea copiar el Tipo de Celda?");

                        if (isConfirmed)
                        {
                            TipoCelda Nuevo = new TipoCelda();

                            Nuevo.DES_TIPOCELDA = selectedRecord.DES_TIPOCELDA;
                            Nuevo.CG_CIA        = 1;
                            Nuevo.USUARIO       = "User";

                            var response = await Http.PostAsJsonAsync("api/TipoCelda", Nuevo);

                            Nuevo.CG_TIPOCELDA = tipoceldas.Max(s => s.CG_TIPOCELDA) + 1;

                            if (response.StatusCode == System.Net.HttpStatusCode.Created)
                            {
                                Grid.Refresh();
                                var tipocelda = await response.Content.ReadFromJsonAsync <TipoCelda>();
                                await InvokeAsync(StateHasChanged);

                                Nuevo.CG_TIPOCELDA = tipocelda.CG_TIPOCELDA;
                                tipoceldas.Add(Nuevo);
                                var itemsJson = JsonSerializer.Serialize(tipocelda);
                                Console.WriteLine(itemsJson);
                                //toastService.ShowToast($"Registrado Correctemente.Vale {StockGuardado.VALE}", TipoAlerta.Success);
                                tipoceldas.OrderByDescending(p => p.CG_TIPOCELDA);
                            }
                        }
                    }
                }
                Refresh();
            }
            if (args.Item.Text == "Excel Export")
            {
                await this.Grid.ExcelExport();
            }
        }
Exemple #9
0
        // Token: 0x06000283 RID: 643 RVA: 0x0000AB1C File Offset: 0x00008F1C
        public Celda descompimir_Celda(string celda_data, short id_celda)
        {
            byte[] array = new byte[celda_data.Length];
            for (int i = 0; i < celda_data.Length; i++)
            {
                array[i] = Convert.ToByte(Hash.get_Hash(celda_data[i]));
            }
            TipoCelda tipo               = (TipoCelda)((array[2] & 56) >> 3);
            bool      esta_activa        = (array[0] & 32) >> 5 != 0;
            bool      es_linea_vision    = (array[0] & 1) != 1;
            bool      flag               = (array[7] & 2) >> 1 != 0;
            short     num                = Convert.ToInt16(((int)(array[0] & 2) << 12) + ((int)(array[7] & 1) << 12) + ((int)array[8] << 6) + (int)array[9]);
            short     layer_object_1_num = Convert.ToInt16(((int)(array[0] & 4) << 11) + ((int)(array[4] & 1) << 12) + ((int)array[5] << 6) + (int)array[6]);
            byte      nivel              = Convert.ToByte((int)(array[1] & 15));
            byte      slope              = Convert.ToByte((array[4] & 60) >> 2);

            return(new Celda(id_celda, esta_activa, tipo, es_linea_vision, nivel, slope, flag ? num : Convert.ToInt16(-1), layer_object_1_num, num, this));
        }
Exemple #10
0
        public Celda descompimir_Celda(string celda_data, short id_celda)
        {
            byte[] informacion_celda = new byte[celda_data.Length];

            for (int i = 0; i < celda_data.Length; i++)
            {
                informacion_celda[i] = Convert.ToByte(Hash.get_Hash(celda_data[i]));
            }

            TipoCelda tipo                     = (TipoCelda)((informacion_celda[2] & 56) >> 3);
            bool      activa                   = (informacion_celda[0] & 32) >> 5 != 0;
            bool      es_linea_vision          = (informacion_celda[0] & 1) != 1;
            bool      tiene_objeto_interactivo = ((informacion_celda[7] & 2) >> 1) != 0;
            short     layer_objeto_2_num       = Convert.ToInt16(((informacion_celda[0] & 2) << 12) + ((informacion_celda[7] & 1) << 12) + (informacion_celda[8] << 6) + informacion_celda[9]);
            short     layer_objeto_1_num       = Convert.ToInt16(((informacion_celda[0] & 4) << 11) + ((informacion_celda[4] & 1) << 12) + (informacion_celda[5] << 6) + informacion_celda[6]);
            byte      nivel                    = Convert.ToByte(informacion_celda[1] & 15);
            byte      slope                    = Convert.ToByte((informacion_celda[4] & 60) >> 2);

            return(new Celda(id_celda, activa, tipo, es_linea_vision, nivel, slope, tiene_objeto_interactivo ? layer_objeto_2_num : Convert.ToInt16(-1), layer_objeto_1_num, layer_objeto_2_num, this));
        }
Exemple #11
0
        public Celda(short _id, TipoCelda _tipo, bool _es_linea_vision, byte _nivel, byte _slope, short _objeto_interactivo_id, short layer_object_1_num, short layer_object_2_num, Mapa _mapa)
        {
            id = _id;

            if (texturas_teleport.Contains(layer_object_1_num) || texturas_teleport.Contains(layer_object_2_num))
            {
                tipo = TipoCelda.CELDA_TELEPORT;
            }
            else if (_tipo == TipoCelda.CELDA_TELEPORT)
            {
                tipo = TipoCelda.CELDA_CAMINABLE;
            }
            else
            {
                tipo = _tipo;
            }

            es_linea_vision       = _es_linea_vision;
            layer_ground_nivel    = _nivel;
            layer_ground_slope    = _slope;
            objeto_interactivo_id = _objeto_interactivo_id;
            mapa = _mapa;

            if (objeto_interactivo_id != -1)
            {
                objeto_interactivo = new ObjetoInteractivo(objeto_interactivo_id, id);
            }

            byte mapa_anchura = mapa.anchura;
            int  _loc5        = id / ((mapa_anchura * 2) - 1);
            int  _loc6        = id - (_loc5 * ((mapa_anchura * 2) - 1));
            int  _loc7        = _loc6 % mapa_anchura;

            y = _loc5 - _loc7;
            x = (id - ((mapa_anchura - 1) * y)) / mapa_anchura;
        }
Exemple #12
0
 public void PintarPunto(int x, int y, TipoCelda tc)
 {
     switch (tc)
     {
         case TipoCelda.Vacio:
             g.FillRectangle(new SolidBrush(Color.White), x * lc + 1, y * lc + 1, lc - 1, lc - 1);
             break;
         case TipoCelda.Pozo:
             g.FillRectangle(new SolidBrush(Color.Green), x * lc + 1, y * lc + 1, lc - 1, lc - 1);
             break;
         case TipoCelda.Carro:
             g.FillRectangle(new SolidBrush(Color.Red), x * lc + 1, y * lc + 1, lc - 1, lc - 1);
             _xCar = x;
             _yCar = y;
             break;
         default:
             break;
     }
     myMapa[x, y] = tc;
     PintarGrilla();
 }
Exemple #13
0
 public Celda()
 {
     this.f         = this.c = 0;
     this.tipoCelda = TipoCelda.CeldaNulo;
     ResetValores();
 }