示例#1
0
        public async Task <List <CargoEntity> > GetCargos(string connection)
        {
            List <CargoEntity> collDatos = new List <CargoEntity>();
            CargoEntity        datos;

            using (MySqlConnection con = new MySqlConnection(connection))
            {
                using (var cmd = con.CreateCommand())
                {
                    cmd.CommandText = $"select * from bd_moira.cargo ";
                    cmd.CommandType = CommandType.Text;

                    await con.OpenAsync();

                    using (var reader = await cmd.ExecuteReaderAsync())
                    {
                        while (await reader.ReadAsync())
                        {
                            datos = new CargoEntity
                            {
                                CargoId     = Convert.ToInt32(reader["INT_PK_CARGO_ID"].ToString()),
                                Descripcion = reader["VC_DESCRIPCION"].ToString(),
                                Estado      = reader["BI_ESTADO"].ToString() == "1" ? true : false
                            };

                            collDatos.Add(datos);
                        }
                    }
                }
            }

            return(collDatos);
        }
示例#2
0
        private void Update()
        {
            var playerInput = PlayerInputManager.PlayerInput;

            var forwardVector = cameraTransform.forward;

            forwardVector.y = 0f;
            forwardVector.Normalize();

            forwardVector *= playerInput.y;

            var rightVector = cameraTransform.right * playerInput.x;

            var inputVector    = forwardVector + rightVector;
            var inputMagnitude = inputVector.magnitude;

            if (inputMagnitude > 1f)
            {
                inputVector.Normalize();
                inputMagnitude = 1f;
            }
            characterMovementController.Move(inputVector, inputMagnitude);
            if (PlayerInputManager.EKeyDown)
            {
                if (characterStateController.IsTranslation == false)
                {
                    if (withCargo == false)
                    {
                        var interaction = characterInteraction.InteractionTake();
                        if (interaction.Item1)
                        {
                            var translationTime = characterStateController.GetTranslationTime(CharacterState.WithCargo);
                            characterStateController.SetCharacterState(CharacterState.WithCargo);
                            withCargo    = true;
                            cargoInHands = interaction.Item2;
                            var direction = cargoInHands.CargoTransform.position - transform.position;
                            direction.y = 0f;
                            direction.Normalize();
                            var rotation = Quaternion.LookRotation(direction);
                            transform.rotation = rotation;
                            StartCoroutine(WaitAndSetCargo(translationTime));
                        }
                    }
                    else
                    if (withCargo == true)
                    {
                        var interaction = characterInteraction.InteractionPut(cargoInHands);
                        characterStateController.SetCharacterState(CharacterState.FreeHands);
                        withCargo = false;
                        cargoInHands.CargoTransform.parent = null;
                        if (!interaction)
                        {
                            cargoInHands.SetFallState();
                        }
                        cargoInHands = null;
                    }
                }
            }
        }
示例#3
0
 public static CargoDto CargoToDto(CargoEntity entity)
 {
     return(new CargoDto
     {
         CargoId = entity.CargoId,
         Descripcion = entity.Descripcion,
         Estado = entity.Estado
     });
 }
示例#4
0
 public void AddCargoOnStartPoint(CargoEntity cargoEntity) => conveyorBeltCargoMover.AddCargoOnStartSlot(cargoEntity);