Skip to content

Commit

Permalink
Updated InputModifier helper and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAlvarezMelucciDCL committed Nov 19, 2024
1 parent 2ce9016 commit 9b4980e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
19 changes: 2 additions & 17 deletions packages/@dcl/ecs/src/components/extended/InputModifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ export interface InputModifierComponentDefinitionExtended
/**
* InputModifier helper with constructor
*/
InputModifier: InputModifierHelper

/**
* Create or replace the component InputModifier in the entity specified
* @param entity - the entity to link the component
* @param inputModifier - the data for this input modifier
*/
addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void
Mode: InputModifierHelper
}

const InputModifierHelper: InputModifierHelper = {
Expand All @@ -46,14 +39,6 @@ export function defineInputModifierComponent(

return {
...theComponent,
InputModifier: InputModifierHelper,
addStandardModifier(entity: Entity, inputModifier: PBInputModifier_StandardInput) {
theComponent.createOrReplace(entity, {
mode: {
$case: 'standard',
standard: inputModifier
}
})
}
Mode: InputModifierHelper
}
}
9 changes: 8 additions & 1 deletion test/ecs/components/InputModifier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ describe('Generated InputModifier ProtoBuf', () => {
const InputModifier = components.InputModifier(newEngine)

testComponentSerialization(InputModifier, {
mode: InputModifier.InputModifier.Standard({ disableAll: true })
mode: InputModifier.Mode.Standard({
disableAll: true,
disableWalk: true,
disableJog: true,
disableRun: true,
disableJump: true,
disableEmote: true
})
})
})
})

0 comments on commit 9b4980e

Please sign in to comment.