Skip to content

Commit

Permalink
TCM: Update B-Human plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasselbring committed Jul 15, 2024
1 parent 31104d8 commit b2efdab
Showing 1 changed file with 59 additions and 4 deletions.
63 changes: 59 additions & 4 deletions resources/plugins/05/B-Human/src/bhuman/message/BHumanMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,54 @@
public class BHumanMessage extends AdvancedMessage {
public static final short BHUMAN_MESSAGE_STRUCT_VERSION = 72;

public static class IndirectKick {
public Timestamp lastKickTimestamp;

public void read(final BitStream __bitStream, final long __timestampBase) {
lastKickTimestamp = __bitStream.readTimestamp(__timestampBase, 24, 8, -1, false);
}
}

public enum InitialToReady__State {
observing,
waiting,
transition,
UNKNOWN
}

public static class InitialToReady {
public InitialToReady__State state;
public boolean gestureDetected;
public int detectedBy;
public Timestamp timestamp;

public void read(final BitStream __bitStream, final long __timestampBase) {
state = InitialToReady__State.values()[Math.min((int) __bitStream.readBits(2), InitialToReady__State.values().length - 1)];
gestureDetected = __bitStream.readBoolean();
detectedBy = __bitStream.readInt(0, 14, 4);
timestamp = __bitStream.readTimestamp(__timestampBase, 11, 4, -1, true);
}
}

public enum Role__Type {
none,
playBall,
freeKickWall,
closestToTeammatesBall,
startSetPlay,
goalkeeper,
attackingGoalkeeper,
defender,
midfielder,
forward,
SACPasser,
UNKNOWN
}

public enum Tactic__Position__Type {
none,
goalkeeper,
attackingGoalkeeper,
defender,
defenderL,
defenderR,
Expand All @@ -44,27 +76,46 @@ public enum Tactic__Position__Type {
forwardM,
forwardL,
forwardR,
SACPasser,
UNKNOWN
}

public enum SetPlay__Type {
none,
directKickOff,
directKickOff5v5,
kiteKickOff,
kiteKickOffensive,
diamondKickOff5v5,
arrowKickOff5v5,
theOneTrueOwnPenaltyKick,
theOneTrueOwnPenaltyKickAttacking,
ownPenaltyKick5v5,
theOneTrueOpponentPenaltyKick,
opponentPenaltyKick5v5,
ownCornerKick,
ownCornerKickAttacking,
ownGoalKick,
ownKickInOwnHalf,
ownKickInOpponentHalf,
passFreeKick5v5,
cornerKick5v5,
opponentCornerKick,
placeholder5v5,
UNKNOWN
}

public enum Tactic__Type {
none,
t011,
t020,
t123,
t100,
t222,
t033,
t211,
t121,
t112,
UNKNOWN
}

Expand All @@ -79,12 +130,12 @@ public static class StrategyStatus {
public Role__Type role;

public void read(final BitStream __bitStream, final long __timestampBase) {
proposedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(2), Tactic__Type.values().length - 1)];
acceptedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(2), Tactic__Type.values().length - 1)];
proposedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Type.values().length - 1)];
acceptedTactic = Tactic__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Type.values().length - 1)];
proposedMirror = __bitStream.readBoolean();
acceptedMirror = __bitStream.readBoolean();
proposedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(4), SetPlay__Type.values().length - 1)];
acceptedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(4), SetPlay__Type.values().length - 1)];
proposedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(5), SetPlay__Type.values().length - 1)];
acceptedSetPlay = SetPlay__Type.values()[Math.min((int) __bitStream.readBits(5), SetPlay__Type.values().length - 1)];
position = Tactic__Position__Type.values()[Math.min((int) __bitStream.readBits(4), Tactic__Position__Type.values().length - 1)];
role = Role__Type.values()[Math.min((int) __bitStream.readBits(4), Role__Type.values().length - 1)];
}
Expand Down Expand Up @@ -231,6 +282,8 @@ public void read(final BitStream __bitStream, final long __timestampBase) {
public WhistleCompact theWhistle = new WhistleCompact();
public BehaviorStatus theBehaviorStatus = new BehaviorStatus();
public StrategyStatus theStrategyStatus = new StrategyStatus();
public IndirectKick theIndirectKick = new IndirectKick();
public InitialToReady theInitialToReady = new InitialToReady();

@Override
public String[] display() {
Expand Down Expand Up @@ -259,5 +312,7 @@ public void init() {
theWhistle.read(__bitStream, __timestampBase);
theBehaviorStatus.read(__bitStream, __timestampBase);
theStrategyStatus.read(__bitStream, __timestampBase);
theIndirectKick.read(__bitStream, __timestampBase);
theInitialToReady.read(__bitStream, __timestampBase);
}
}

0 comments on commit b2efdab

Please sign in to comment.