File tree Expand file tree Collapse file tree 1 file changed +28
-7
lines changed
src/main/kotlin/com/github/ilovegamecoding/intellijcodexp/startup Expand file tree Collapse file tree 1 file changed +28
-7
lines changed Original file line number Diff line number Diff line change 1
1
package com.github.ilovegamecoding.intellijcodexp.startup
2
2
3
- import com.github.ilovegamecoding.intellijcodexp.core.CodeXP
3
+ import com.github.ilovegamecoding.intellijcodexp.model.CodeXPChallenge
4
+ import com.github.ilovegamecoding.intellijcodexp.services.CodeXPService
4
5
import com.intellij.openapi.components.service
5
- import com.intellij.openapi.diagnostic.thisLogger
6
6
import com.intellij.openapi.project.Project
7
7
import com.intellij.openapi.startup.StartupActivity
8
8
9
+ /* *
10
+ * CodeXPStartupActivity class
11
+ *
12
+ * This class is used to initialize the plugin when the IDE starts.
13
+ */
9
14
class CodeXPStartupActivity : StartupActivity {
10
15
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
+ )
16
37
}
17
38
}
18
39
}
You can’t perform that action at this time.
0 commit comments