MCPcopy Create free account
hub / github.com/OneBitCodeBlog/onebitlife / animationStatus

Function animationStatus

src/Services/AnimationService.js:1–69  ·  view source on GitHub ↗
(
  mindHabit,
  moneyHabit,
  bodyHabit,
  funHabit,
  setMind,
  setMoney,
  setRobot
)

Source from the content-addressed store, hash-verified

1function animationStatus(
2 mindHabit,
3 moneyHabit,
4 bodyHabit,
5 funHabit,
6 setMind,
7 setMoney,
8 setRobot
9) {
10 if (
11 mindHabit === 0 ||
12 moneyHabit === 0 ||
13 bodyHabit === 0 ||
14 funHabit === 0
15 ) {
16 setMind("");
17 setMoney("");
18 setRobot(require("../assets/robot/robot-00-00.json"));
19 } else {
20 if (mindHabit === 0.5) {
21 setMind(require("../assets/education/education-50.json"));
22 } else if (mindHabit === 0.25) {
23 setMind(require("../assets/education/education-25.json"));
24 } else {
25 setMind(require("../assets/education/education-100.json"));
26 }
27
28 if (moneyHabit === 0.5) {
29 setMoney(require("../assets/money/money-50.json"));
30 } else if (moneyHabit === 0.25) {
31 setMoney(require("../assets/money/money-25.json"));
32 } else {
33 setMoney(require("../assets/money/money-100.json"));
34 }
35 if (bodyHabit === 0.25 && funHabit === undefined) {
36 setRobot(require("../assets/robot/robot-100-25.json"));
37 } else if (bodyHabit === 0.5 && funHabit === undefined) {
38 setRobot(require("../assets/robot/robot-100-50.json"));
39 } else if (bodyHabit === 1 && funHabit === undefined) {
40 setRobot(require("../assets/robot/robot-100-100.json"));
41 } else if (bodyHabit === undefined && funHabit === 0.25) {
42 setRobot(require("../assets/robot/robot-100-25.json"));
43 } else if (bodyHabit === undefined && funHabit === 0.5) {
44 setRobot(require("../assets/robot/robot-100-50.json"));
45 } else if (bodyHabit === undefined && funHabit === 1) {
46 setRobot(require("../assets/robot/robot-100-100.json"));
47 } else if (bodyHabit === 0.25 && funHabit === 1) {
48 setRobot(require("../assets/robot/robot-100-25.json"));
49 } else if (bodyHabit === 0.5 && funHabit === 0.5) {
50 setRobot(require("../assets/robot/robot-50-50.json"));
51 } else if (bodyHabit === 0.25 && funHabit === 0.5) {
52 setRobot(require("../assets/robot/robot-50-25.json"));
53 } else if (bodyHabit === 1 && funHabit === 0.5) {
54 setRobot(require("../assets/robot/robot-50-100.json"));
55 } else if (bodyHabit === 0.5 && funHabit === 0.25) {
56 setRobot(require("../assets/robot/robot-25-50.json"));
57 } else if (bodyHabit === 0.25 && funHabit === 0.25) {
58 setRobot(require("../assets/robot/robot-25-25.json"));
59 } else if (bodyHabit === 1 && funHabit === 0.25) {
60 setRobot(require("../assets/robot/robot-25-100.json"));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected