Skip to content

Commit 21a75ea

Browse files
committed
feat: Add initialize plugin logic from CodeXPService and add typing, action challenge
1 parent 21b7c1d commit 21a75ea

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed
Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
11
package com.github.ilovegamecoding.intellijcodexp.startup
22

3-
import com.github.ilovegamecoding.intellijcodexp.core.CodeXP
3+
import com.github.ilovegamecoding.intellijcodexp.model.CodeXPChallenge
4+
import com.github.ilovegamecoding.intellijcodexp.services.CodeXPService
45
import com.intellij.openapi.components.service
5-
import com.intellij.openapi.diagnostic.thisLogger
66
import com.intellij.openapi.project.Project
77
import com.intellij.openapi.startup.StartupActivity
88

9+
/**
10+
* CodeXPStartupActivity class
11+
*
12+
* This class is used to initialize the plugin when the IDE starts.
13+
*/
914
class CodeXPStartupActivity : StartupActivity {
1015
override fun runActivity(project: Project) {
11-
val state = service<CodeXP>()
12-
if (!state.hasExecuted) {
13-
// TODO: Add plugin initialize logic
14-
15-
state.hasExecuted = true
16+
with(service<CodeXPService>()) {
17+
initializePlugin(
18+
listOf(
19+
CodeXPChallenge(
20+
type = CodeXPChallenge.Type.TYPING_COUNT.ordinal,
21+
name = "Typing",
22+
description = "Just type anything. We will give you XP for it.",
23+
rewardXP = 100,
24+
value = 0,
25+
goal = 10
26+
),
27+
CodeXPChallenge(
28+
type = CodeXPChallenge.Type.ACTION_COUNT.ordinal,
29+
name = "Action",
30+
description = "Just do anything. We will give you XP for it.",
31+
rewardXP = 100,
32+
value = 0,
33+
goal = 10
34+
)
35+
)
36+
)
1637
}
1738
}
1839
}

0 commit comments

Comments
 (0)