forked from CleverNucleus/data-attributes
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ref] Refractored all field components, added parsing
- Loading branch information
1 parent
22b3430
commit 0e05f17
Showing
7 changed files
with
54 additions
and
47 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/bibireden/data_attributes/api/parser/Parsing.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.bibireden.data_attributes.api.parser | ||
|
||
typealias Parser<I, O> = (I) -> O? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 14 additions & 7 deletions
21
src/main/kotlin/com/bibireden/data_attributes/ui/components/fields/EditFieldComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
src/main/kotlin/com/bibireden/data_attributes/ui/components/fields/FieldComponents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package com.bibireden.data_attributes.ui.components.fields | ||
|
||
class FieldComponents { | ||
// fun edit(): EditFieldComponent {} | ||
import net.minecraft.util.Identifier | ||
|
||
object FieldComponents { | ||
fun identifier(onConfirmation: EditFieldDecision<Identifier>, onCancel: EditFieldCancellation<Identifier>? = null): EditFieldComponent<Identifier> { | ||
return EditFieldComponent(Identifier::tryParse, onConfirmation, onCancel) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters