Skip to content

Commit dccb0a8

Browse files
committed
hotbar, interaction, inventory docs
1 parent 4a6bd89 commit dccb0a8

25 files changed

+146
-57
lines changed

src/main/kotlin/com/lambda/interaction/request/ActionInfo.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ package com.lambda.interaction.request
1919

2020
import com.lambda.interaction.construction.context.BuildContext
2121

22+
/**
23+
* A simple interface to provide a basic object to hold key information that managers might need if information
24+
* must persist longer than the request.
25+
*/
2226
interface ActionInfo {
2327
val context: BuildContext
2428
val pendingInteractionsList: MutableCollection<BuildContext>

src/main/kotlin/com/lambda/interaction/request/DebugLogger.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ import imgui.flag.ImGuiWindowFlags
3535
import java.awt.Color
3636
import java.util.*
3737

38+
/**
39+
* A simple logger that can be used to display information about what is happening within the managers.
40+
*/
3841
class DebugLogger(
3942
val name: String
4043
) {

src/main/kotlin/com/lambda/interaction/request/PositionBlocking.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ package com.lambda.interaction.request
1919

2020
import net.minecraft.util.math.BlockPos
2121

22+
/**
23+
* Provides a [blockedPositions] list to inform other managers what positions should not be processed.
24+
*
25+
* Reasons a position could be blocked include pending interactions and or active interactions.
26+
*/
2227
interface PositionBlocking {
2328
val blockedPositions: List<BlockPos>
2429
}

src/main/kotlin/com/lambda/interaction/request/PostActionHandler.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafe
2525
import com.lambda.interaction.request.breaking.BrokenBlockHandler
2626
import com.lambda.util.collections.LimitedDecayQueue
2727

28+
/**
29+
* A simple interface for handlers of actions that need some sort of server response after being executed.
30+
*/
2831
abstract class PostActionHandler<T : ActionInfo> {
2932
abstract val pendingActions: LimitedDecayQueue<T>
3033

src/main/kotlin/com/lambda/interaction/request/Request.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ package com.lambda.interaction.request
1919

2020
import com.lambda.context.Automated
2121

22+
/**
23+
* A simple format to ensure basic requirements and information when requesting a manager.
24+
*
25+
* @property requestId Used for tracking how many requests there have been and what number this request is.
26+
* @property fresh If this request is new.
27+
* @property done If this request has been completed.
28+
*/
2229
abstract class Request : Automated {
23-
abstract val requestID: Int
30+
abstract val requestId: Int
2431
var fresh = true
2532

2633
abstract val done: Boolean

src/main/kotlin/com/lambda/interaction/request/RequestConfig.kt

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/main/kotlin/com/lambda/interaction/request/RequestHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ abstract class RequestHandler<R : Request>(
5555
var queuedRequest: R? = null; protected set
5656

5757
/**
58-
* Represents if the handler performed any external actions within this tick
58+
* Represents if the handler performed any actions within this tick
5959
*/
6060
var activeThisTick = false; protected set
6161

src/main/kotlin/com/lambda/interaction/request/breaking/BreakConfig.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ package com.lambda.interaction.request.breaking
1919

2020
import com.lambda.config.groups.BuildConfig
2121
import com.lambda.event.Event
22-
import com.lambda.interaction.request.RequestConfig
2322
import com.lambda.util.Describable
2423
import com.lambda.util.NamedEnum
2524
import net.minecraft.block.Block
2625
import java.awt.Color
2726

28-
interface BreakConfig : RequestConfig {
27+
interface BreakConfig {
2928
val breakMode: BreakMode
3029
val sorter: SortMode
3130
val rebreak: Boolean

src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ import kotlin.math.max
104104
import kotlin.math.min
105105

106106
/**
107-
* This manager is responsible for breaking blocks in the most efficient manner possible. It can be accessed
108-
* from anywhere through a [BreakRequest], although it is not designed in the image of thread safety.
107+
* Manager responsible for breaking blocks in the most efficient manner possible. It can be accessed
108+
* from anywhere through a [BreakRequest].
109109
*
110110
* If configured with the right options enabled, this manager can break two blocks simultaneously, even if the two breaks come from
111111
* different requests. Each break will be handled using its own config, and just like the other managers, priority is a first-come, first-served

src/main/kotlin/com/lambda/interaction/request/breaking/BreakRequest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import net.minecraft.util.math.BlockPos
3636
*
3737
* The callbacks can be used to keep track of the break progress.
3838
*
39-
* The class has a private constructor to force use of the cleaner [BreakRequestDsl] builder. This is
39+
* A private constructor is used to force use of the cleaner [BreakRequestDsl] builder. This is
4040
* accessed through the [breakRequest] method.
4141
*
4242
* @param contexts A collection of [BreakContext]'s gathered from the [com.lambda.interaction.construction.simulation.BuildSimulator].
@@ -47,7 +47,7 @@ data class BreakRequest private constructor(
4747
val pendingInteractions: MutableCollection<BuildContext>,
4848
private val automated: Automated
4949
) : Request(), LogContext, Automated by automated {
50-
override val requestID = ++requestCount
50+
override val requestId = ++requestCount
5151

5252
var onStart: (SafeContext.(BlockPos) -> Unit)? = null
5353
var onUpdate: (SafeContext.(BlockPos) -> Unit)? = null
@@ -65,7 +65,7 @@ data class BreakRequest private constructor(
6565

6666
override fun getLogContextBuilder(): LogContextBuilder.() -> Unit = {
6767
group("Break Request") {
68-
value("Request ID", requestID)
68+
value("Request ID", requestId)
6969
value("Contexts", contexts.size)
7070
group("Callbacks") {
7171
value("onStart", onStart != null)

0 commit comments

Comments
 (0)