function cgks_PlayerInputHandlingSystem_onTickEntity__zL0x1I($this, $entity) {
var $this_$iv, $type$iv, $this_$iv$iv, $name$iv$iv, var$6, var$7, var$8, var$9, var$10, var$11, $st, $previousState, $previousDirection, $previousAnimation, $stateChanged, $directionChanged, var$18, var$19, var$20;
$this.$timeSinceLastAttack = $this.$timeSinceLastAttack + cgqf_IntervalSystem_getDeltaTime($this);
$this_$iv = $this;
cgkc_PlayerStateComponent_$callClinit();
$type$iv = cgkc_PlayerStateComponent_Companion;
$this_$iv$iv = cgqf_EntityComponentContext_getComponentService($this_$iv);
if (cgqfc_Bag_hasNoValueAtIndex(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv))) {
$name$iv$iv = (kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_PlayerStateComponent))).$getSimpleName();
if ($name$iv$iv === null)
$name$iv$iv = cgqf_ComponentService_toComponentName($this_$iv$iv, kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_PlayerStateComponent)));
var$6 = cgqf_ComponentService_getHoldersBag($this_$iv$iv);
var$7 = cgqf_ComponentType_getId($type$iv);
var$8 = cgqf_ComponentService_getWorld($this_$iv$iv);
var$9 = 0;
var$10 = cgqf_World_getCapacity(cgqf_ComponentService_getWorld($this_$iv$iv));
var$11 = $rt_createArray(cgkc_PlayerStateComponent, var$10);
while (var$9 < var$10) {
var$11.data[var$9] = null;
var$9 = var$9 + 1 | 0;
}
cgqfc_Bag_set(var$6, var$7, cgqf_ComponentsHolder__init_(var$8, $name$iv$iv, var$11));
}
var$8 = cgqfc_Bag_get(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv));
kji_Intrinsics_checkNotNull(var$8, $rt_s(433));
var$6 = var$8;
var$6 = cgqf_ComponentsHolder_get__zL0x1I(var$6, $entity);
$st = var$6;
$previousState = cgkc_PlayerStateComponent_getState($st);
$previousDirection = cgkc_PlayerStateComponent_getDirectionState($st);
$previousAnimation = cgkc_PlayerStateComponent_getAnimation($st);
cgkc_PlayerStateEnum_$callClinit();
if ($previousState === cgkc_PlayerStateEnum_RUNNING)
$this.$runningTimer = $this.$runningTimer + cgqf_IntervalSystem_getDeltaTime($this);
if ($this.$runningTimer > $this.$runningDelta) {
cgkc_PlayerStateComponent_setState($st, cgkc_PlayerStateEnum_IDLE);
$this.$runningTimer = 0.0;
}
if (cbg_Gdx_input.$isKeyJustPressed(22)) {
cgkc_PlayerDirectionEnum_$callClinit();
cgkc_PlayerStateComponent_setDirectionState($st, cgkc_PlayerDirectionEnum_RIGHT);
} else if (cbg_Gdx_input.$isKeyJustPressed(21)) {
cgkc_PlayerDirectionEnum_$callClinit();
cgkc_PlayerStateComponent_setDirectionState($st, cgkc_PlayerDirectionEnum_LEFT);
}
if (!(!cbg_Gdx_input.$isKeyPressed(129) && !cbg_Gdx_input.$isKeyPressed(130)) && $previousState !== cgkc_PlayerStateEnum_ATTACKING && $this.$timeSinceLastAttack > 0.30000001192092896) {
cgkc_PlayerStateComponent_setState($st, cgkc_PlayerStateEnum_ATTACKING);
$this.$timeSinceLastAttack = 0.0;
} else if (!(!cbg_Gdx_input.$isKeyPressed(22) && !cbg_Gdx_input.$isKeyPressed(21)))
cgkc_PlayerStateComponent_setState($st, cgkc_PlayerStateEnum_RUNNING);
$stateChanged = cgkc_PlayerStateComponent_getState($st) === $previousState ? 0 : 1;
$directionChanged = $previousDirection === cgkc_PlayerStateComponent_getDirectionState($st) ? 0 : 1;
if (!(!$stateChanged && !$directionChanged)) {
cgkc_AnimationComponent_$callClinit();
$type$iv = cgkc_AnimationComponent_Companion;
$this_$iv$iv = cgqf_EntityComponentContext_getComponentService($this_$iv);
if (cgqfc_Bag_hasNoValueAtIndex(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv))) {
$name$iv$iv = (kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent))).$getSimpleName();
if ($name$iv$iv === null)
$name$iv$iv = cgqf_ComponentService_toComponentName($this_$iv$iv, kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent)));
var$6 = cgqf_ComponentService_getHoldersBag($this_$iv$iv);
var$9 = cgqf_ComponentType_getId($type$iv);
var$18 = cgqf_ComponentService_getWorld($this_$iv$iv);
var$10 = 0;
var$19 = cgqf_World_getCapacity(cgqf_ComponentService_getWorld($this_$iv$iv));
var$11 = $rt_createArray(cgkc_AnimationComponent, var$19);
while (var$10 < var$19) {
var$11.data[var$10] = null;
var$10 = var$10 + 1 | 0;
}
cgqfc_Bag_set(var$6, var$9, cgqf_ComponentsHolder__init_(var$18, $name$iv$iv, var$11));
}
var$6 = cgqfc_Bag_get(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv));
kji_Intrinsics_checkNotNull(var$6, $rt_s(433));
var$6 = var$6;
var$20 = cgqf_ComponentsHolder_get__zL0x1I(var$6, $entity);
$type$iv = cgkc_PlayerStateComponent_Companion;
$this_$iv$iv = cgqf_EntityComponentContext_getComponentService($this_$iv);
if (cgqfc_Bag_hasNoValueAtIndex(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv))) {
$name$iv$iv = (kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_PlayerStateComponent))).$getSimpleName();
if ($name$iv$iv === null)
$name$iv$iv = cgqf_ComponentService_toComponentName($this_$iv$iv, kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_PlayerStateComponent)));
var$6 = cgqf_ComponentService_getHoldersBag($this_$iv$iv);
var$7 = cgqf_ComponentType_getId($type$iv);
var$8 = cgqf_ComponentService_getWorld($this_$iv$iv);
var$9 = 0;
var$10 = cgqf_World_getCapacity(cgqf_ComponentService_getWorld($this_$iv$iv));
var$11 = $rt_createArray(cgkc_PlayerStateComponent, var$10);
while (var$9 < var$10) {
var$11.data[var$9] = null;
var$9 = var$9 + 1 | 0;
}
cgqfc_Bag_set(var$6, var$7, cgqf_ComponentsHolder__init_(var$8, $name$iv$iv, var$11));
}
var$6 = cgqfc_Bag_get(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv));
kji_Intrinsics_checkNotNull(var$6, $rt_s(433));
var$6 = var$6;
var$6 = cgqf_ComponentsHolder_get__zL0x1I(var$6, $entity);
cgkc_AnimationComponent_setAnimation(var$20, cgkc_PlayerStateComponent_getAnimation(var$6));
$type$iv = cgkc_AnimationComponent_Companion;
$this_$iv$iv = cgqf_EntityComponentContext_getComponentService($this_$iv);
if (cgqfc_Bag_hasNoValueAtIndex(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv))) {
$name$iv$iv = (kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent))).$getSimpleName();
if ($name$iv$iv === null)
$name$iv$iv = cgqf_ComponentService_toComponentName($this_$iv$iv, kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent)));
var$6 = cgqf_ComponentService_getHoldersBag($this_$iv$iv);
var$7 = cgqf_ComponentType_getId($type$iv);
var$8 = cgqf_ComponentService_getWorld($this_$iv$iv);
var$9 = 0;
var$10 = cgqf_World_getCapacity(cgqf_ComponentService_getWorld($this_$iv$iv));
var$11 = $rt_createArray(cgkc_AnimationComponent, var$10);
while (var$9 < var$10) {
var$11.data[var$9] = null;
var$9 = var$9 + 1 | 0;
}
cgqfc_Bag_set(var$6, var$7, cgqf_ComponentsHolder__init_(var$8, $name$iv$iv, var$11));
}
var$6 = cgqfc_Bag_get(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv));
kji_Intrinsics_checkNotNull(var$6, $rt_s(433));
var$6 = var$6;
var$6 = cgqf_ComponentsHolder_get__zL0x1I(var$6, $entity);
cgkc_AnimationComponent_setTimer(var$6, 0.0);
if (cgkc_PlayerStateComponent_getState($st) === cgkc_PlayerStateEnum_ATTACKING) {
$type$iv = cgkc_AnimationComponent_Companion;
$this_$iv$iv = cgqf_EntityComponentContext_getComponentService($this_$iv);
if (cgqfc_Bag_hasNoValueAtIndex(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv))) {
$name$iv$iv = (kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent))).$getSimpleName();
if ($name$iv$iv === null)
$name$iv$iv = cgqf_ComponentService_toComponentName($this_$iv$iv, kji_Reflection_getOrCreateKotlinClass($rt_cls(cgkc_AnimationComponent)));
var$6 = cgqf_ComponentService_getHoldersBag($this_$iv$iv);
var$7 = cgqf_ComponentType_getId($type$iv);
var$8 = cgqf_ComponentService_getWorld($this_$iv$iv);
var$9 = 0;
var$10 = cgqf_World_getCapacity(cgqf_ComponentService_getWorld($this_$iv$iv));
var$11 = $rt_createArray(cgkc_AnimationComponent, var$10);
while (var$9 < var$10) {
var$11.data[var$9] = null;
var$9 = var$9 + 1 | 0;
}
cgqfc_Bag_set(var$6, var$7, cgqf_ComponentsHolder__init_(var$8, $name$iv$iv, var$11));
}
var$6 = cgqfc_Bag_get(cgqf_ComponentService_getHoldersBag($this_$iv$iv), cgqf_ComponentType_getId($type$iv));
kji_Intrinsics_checkNotNull(var$6, $rt_s(433));
var$6 = var$6;
var$6 = cgqf_ComponentsHolder_get__zL0x1I(var$6, $entity);
cgkc_AnimationComponent_setOnAnimationFinish(var$6, cgks_PlayerInputHandlingSystem$onTickEntity$1__init_($this, $entity, $previousAnimation, $st, $previousState));
}
}
}