Skip to content

Commit

Permalink
actually what did intellij do
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingPig525 committed Jun 5, 2024
1 parent 158abe5 commit ea9a482
Show file tree
Hide file tree
Showing 19 changed files with 934 additions and 904 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

open class Block<T>(val codeBlock: String, var items: MutableList<T>, val action: String, val extra: String = "") :
io.github.flyingpig525.base.JsonData where T : Item, T : io.github.flyingpig525.base.JsonData {
JsonData where T : Item, T : JsonData {
init {
var i = 0
items = items.map { item ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class BracketBlock<T>(val open: Boolean = true, val type: String) : io.github.flyingpig525.base.JsonData,
Block<T>("bracket", mutableListOf(), "") where T : Item, T : io.github.flyingpig525.base.JsonData {
class BracketBlock<T>(val open: Boolean = true, val type: String) : JsonData,
Block<T>("bracket", mutableListOf(), "") where T : Item, T : JsonData {
override fun getJsonData(): String {
return """{
"id": "bracket",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class CallFunctionBlock<T>(funcName: String) : Block<T>(
"call_func",
mutableListOf(),
"",
"data: \"$funcName\""
) where T : Item, T : io.github.flyingpig525.base.JsonData
) where T : Item, T : JsonData
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class CallProcessBlock<T>(processName: String) : Block<T>(
"call_process",
mutableListOf(),
"",
"data: \"$processName\""
) where T : Item, T : io.github.flyingpig525.base.JsonData
) where T : Item, T : JsonData
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class ElseBlock<T> : Block<T>("else", mutableListOf(), "") where T : Item, T : io.github.flyingpig525.base.JsonData {
class ElseBlock<T> : Block<T>("else", mutableListOf(), "") where T : Item, T : JsonData {
override fun getJsonData(): String {
return """
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class EventBlock<T>(val type: Type, event: String) :
Block<T>("process", mutableListOf(), event) where T : Item, T : io.github.flyingpig525.base.JsonData {
Block<T>("process", mutableListOf(), event) where T : Item, T : JsonData {
override fun getJsonData(): String {
return """
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class FunctionBlock<T>(name: String = "PutNameHere") :
Block<T>("func", mutableListOf(), name) where T : Item, T : io.github.flyingpig525.base.JsonData {
Block<T>("func", mutableListOf(), name) where T : Item, T : JsonData {
override fun getJsonData(): String {
return """
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.flyingpig525.base.block

import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.item.Item

class ProcessBlock<T>(name: String = "PutNameHere") :
Block<T>("process", mutableListOf(), name) where T : Item, T : io.github.flyingpig525.base.JsonData {
Block<T>("process", mutableListOf(), name) where T : Item, T : JsonData {
override fun getJsonData(): String {
return """
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

package io.github.flyingpig525.base.block.category

import io.github.flyingpig525.base.Items
import io.github.flyingpig525.base.JsonData
import io.github.flyingpig525.base.Template
import io.github.flyingpig525.base.block.Block
import io.github.flyingpig525.base.item.Item
import io.github.flyingpig525.base.item.ItemCollection


class ControlCategory<T> internal constructor(private val template: io.github.flyingpig525.base.Template<T>) where T : Item, T : JsonData {
class ControlCategory<T> internal constructor(private val template: Template<T>) where T : Item, T : JsonData {
private val blocks = template.blocks

private fun block(items: io.github.flyingpig525.base.Items<T>, action: String) {
private fun block(items: Items<T>, action: String) {
blocks += Block("control", ItemCollection(items).items, action)
}

Expand Down Expand Up @@ -60,7 +62,7 @@ class ControlCategory<T> internal constructor(private val template: io.github.fl
*
* (*) = Optional
*/
fun wait(items: io.github.flyingpig525.base.Items<T>) = block(items, "Wait")
fun wait(items: Items<T>) = block(items, "Wait")


}
Loading

0 comments on commit ea9a482

Please sign in to comment.