From d513e80c07a6da5dd37b386a83a22795c6ccdcb7 Mon Sep 17 00:00:00 2001 From: Kaj Kowalski Date: Sat, 24 May 2025 04:16:02 +0200 Subject: [PATCH] refactor: rename states for clarity and consistency - Updated state names in constants and related files from WAIT, REACT, TYPE, SLEEP to WAITING, REACTING, TYPING, SLEEPING. - Adjusted all references to the renamed states across the codebase, including state handlers and transition logic. - Ensured that logging messages reflect the new state names for better readability. --- README.md | 2 +- examples/basic-demo/basic-demo.js | 8 +- examples/basic-demo/simple-example.js | 2 +- examples/mock-demo/owen_test_demo.html | 910 ++++++++++++++++++------- src/constants.js | 8 +- src/core/OwenAnimationContext.js | 24 +- src/index.d.ts | 8 +- src/states/ReactStateHandler.js | 8 +- src/states/SleepStateHandler.js | 14 +- src/states/StateFactory.js | 8 +- src/states/TypeStateHandler.js | 8 +- src/states/WaitStateHandler.js | 8 +- 12 files changed, 694 insertions(+), 314 deletions(-) diff --git a/README.md b/README.md index 54edd77..bf9766b 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ customStates.set("custom", CustomStateHandler); const owenSystem = await OwenSystemFactory.createCustomOwenSystem(gltfModel, scene, customStates); // Manual state transitions -await owenSystem.transitionTo(States.REACT, Emotions.HAPPY); +await owenSystem.transitionTo(States.REACTING, Emotions.HAPPY); ``` ## 🎮 Animation Naming Convention diff --git a/examples/basic-demo/basic-demo.js b/examples/basic-demo/basic-demo.js index 2305cc6..5fd6289 100644 --- a/examples/basic-demo/basic-demo.js +++ b/examples/basic-demo/basic-demo.js @@ -177,16 +177,16 @@ class OwenDemo { switch (event.key) { case '1': - this.owenSystem.transitionTo(States.WAIT) + this.owenSystem.transitionTo(States.WAITING) break case '2': - this.owenSystem.transitionTo(States.REACT) + this.owenSystem.transitionTo(States.REACTING) break case '3': - this.owenSystem.transitionTo(States.TYPE) + this.owenSystem.transitionTo(States.TYPING) break case '4': - this.owenSystem.transitionTo(States.SLEEP) + this.owenSystem.transitionTo(States.SLEEPING) break case ' ': this.sendTestMessage() diff --git a/examples/basic-demo/simple-example.js b/examples/basic-demo/simple-example.js index bce243a..ce07c1b 100644 --- a/examples/basic-demo/simple-example.js +++ b/examples/basic-demo/simple-example.js @@ -92,7 +92,7 @@ class SimpleOwenExample { * @returns {Promise} */ async demonstrateStateTransitions () { - const states = [States.REACT, States.TYPE, States.WAIT, States.SLEEP] + const states = [ States.REACTING, States.TYPING, States.WAITING, States.SLEEPING ] for (const state of states) { console.log(`🔄 Transitioning to ${state.toUpperCase()} state...`) diff --git a/examples/mock-demo/owen_test_demo.html b/examples/mock-demo/owen_test_demo.html index 71571a1..8d6f378 100644 --- a/examples/mock-demo/owen_test_demo.html +++ b/examples/mock-demo/owen_test_demo.html @@ -1,10 +1,19 @@ - + - Owen Animation System Test + Owen Animation System Demo - Implementation Test +