Skip to content

Commit b2efdab

Browse files
committed
TCM: Update B-Human plugin
1 parent 31104d8 commit b2efdab

File tree

1 file changed

+59
-4
lines changed

1 file changed

+59
-4
lines changed

resources/plugins/05/B-Human/src/bhuman/message/BHumanMessage.java

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,54 @@
1717
public class BHumanMessage extends AdvancedMessage {
1818
public static final short BHUMAN_MESSAGE_STRUCT_VERSION = 72;
1919

20+
public static class IndirectKick {
21+
public Timestamp lastKickTimestamp;
22+
23+
public void read(final BitStream __bitStream, final long __timestampBase) {
24+
lastKickTimestamp = __bitStream.readTimestamp(__timestampBase, 24, 8, -1, false);
25+
}
26+
}
27+
28+
public enum InitialToReady__State {
29+
observing,
30+
waiting,
31+
transition,
32+
UNKNOWN
33+
}
34+
35+
public static class InitialToReady {
36+
public InitialToReady__State state;
37+
public boolean gestureDetected;
38+
public int detectedBy;
39+
public Timestamp timestamp;
40+
41+
public void read(final BitStream __bitStream, final long __timestampBase) {
42+
state = InitialToReady__State.values()[Math.min((int) __bitStream.readBits(2), InitialToReady__State.values().length - 1)];
43+
gestureDetected = __bitStream.readBoolean();
44+
detectedBy = __bitStream.readInt(0, 14, 4);
45+
timestamp = __bitStream.readTimestamp(__timestampBase, 11, 4, -1, true);
46+
}
47+
}
48+
2049
public enum Role__Type {
2150
none,
2251
playBall,
2352
freeKickWall,
2453
closestToTeammatesBall,
2554
startSetPlay,
2655
goalkeeper,
56+
attackingGoalkeeper,
2757
defender,
2858
midfielder,
2959
forward,
60+
SACPasser,
3061
UNKNOWN
3162
}
3263

3364
public enum Tactic__Position__Type {
3465
none,
3566
goalkeeper,
67+
attackingGoalkeeper,
3668
defender,
3769
defenderL,
3870
defenderR,
@@ -44,27 +76,46 @@ public enum Tactic__Position__Type {
4476
forwardM,
4577
forwardL,
4678
forwardR,
79+
SACPasser,
4780
UNKNOWN
4881
}
4982

5083
public enum SetPlay__Type {
5184
none,
5285
directKickOff,
86+
directKickOff5v5,
5387
kiteKickOff,
88+
kiteKickOffensive,
89+
diamondKickOff5v5,
90+
arrowKickOff5v5,
5491
theOneTrueOwnPenaltyKick,
92+
theOneTrueOwnPenaltyKickAttacking,
93+
ownPenaltyKick5v5,
5594
theOneTrueOpponentPenaltyKick,
95+
opponentPenaltyKick5v5,
5696
ownCornerKick,
97+
ownCornerKickAttacking,
5798
ownGoalKick,
5899
ownKickInOwnHalf,
59100
ownKickInOpponentHalf,
101+
passFreeKick5v5,
102+
cornerKick5v5,
60103
opponentCornerKick,
104+
placeholder5v5,
61105
UNKNOWN
62106
}
63107

64108
public enum Tactic__Type {
65109
none,
110+
t011,
111+
t020,
66112
t123,
113+
t100,
67114
t222,
115+
t033,
116+
t211,
117+
t121,
118+
t112,
68119
UNKNOWN
69120
}
70121

@@ -79,12 +130,12 @@ public static class StrategyStatus {
79130
public Role__Type role;
80131

81132
public void read(final BitStream __bitStream, final long __timestampBase) {
82-
proposedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(2), Tactic__Type.values().length - 1)];
83-
acceptedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(2), Tactic__Type.values().length - 1)];
133+
proposedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Type.values().length - 1)];
134+
acceptedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Type.values().length - 1)];
84135
proposedMirror = __bitStream.readBoolean();
85136
acceptedMirror = __bitStream.readBoolean();
86-
proposedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(4), SetPlay__Type.values().length - 1)];
87-
acceptedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(4), SetPlay__Type.values().length - 1)];
137+
proposedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(5), SetPlay__Type.values().length - 1)];
138+
acceptedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(5), SetPlay__Type.values().length - 1)];
88139
position = Tactic__Position__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Position__Type.values().length - 1)];
89140
role = Role__Type.values()[Math.min((int) __bitStream.readBits(4), Role__Type.values().length - 1)];
90141
}
@@ -231,6 +282,8 @@ public void read(final BitStream __bitStream, final long __timestampBase) {
231282
public WhistleCompact theWhistle = new WhistleCompact();
232283
public BehaviorStatus theBehaviorStatus = new BehaviorStatus();
233284
public StrategyStatus theStrategyStatus = new StrategyStatus();
285+
public IndirectKick theIndirectKick = new IndirectKick();
286+
public InitialToReady theInitialToReady = new InitialToReady();
234287

235288
@Override
236289
public String[] display() {
@@ -259,5 +312,7 @@ public void init() {
259312
theWhistle.read(__bitStream, __timestampBase);
260313
theBehaviorStatus.read(__bitStream, __timestampBase);
261314
theStrategyStatus.read(__bitStream, __timestampBase);
315+
theIndirectKick.read(__bitStream, __timestampBase);
316+
theInitialToReady.read(__bitStream, __timestampBase);
262317
}
263318
}

0 commit comments

Comments
 (0)