Skip to content

Commit

Permalink
Fix MoC cycle counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed May 9, 2024
1 parent 6c5c7d8 commit f1d3ece
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 215 deletions.
176 changes: 88 additions & 88 deletions src/generated/main/emu/lunarcore/proto/ChallengeInfoOuterClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ public static final class ChallengeInfo extends ProtoMessage<ChallengeInfo> impl
private static final long serialVersionUID = 0L;

/**
* <code>optional uint32 score = 2;</code>
* <code>optional uint32 round_count = 2;</code>
*/
private int score;
private int roundCount;

/**
* <code>optional uint32 score_two = 4;</code>
* <code>optional uint32 score = 3;</code>
*/
private int scoreTwo;
private int score;

/**
* <code>optional uint32 round_count = 13;</code>
* <code>optional uint32 score_two = 4;</code>
*/
private int roundCount;
private int scoreTwo;

/**
* <code>optional uint32 challenge_id = 14;</code>
Expand Down Expand Up @@ -64,113 +64,113 @@ public static ChallengeInfo newInstance() {
}

/**
* <code>optional uint32 score = 2;</code>
* @return whether the score field is set
* <code>optional uint32 round_count = 2;</code>
* @return whether the roundCount field is set
*/
public boolean hasScore() {
public boolean hasRoundCount() {
return (bitField0_ & 0x00000001) != 0;
}

/**
* <code>optional uint32 score = 2;</code>
* <code>optional uint32 round_count = 2;</code>
* @return this
*/
public ChallengeInfo clearScore() {
public ChallengeInfo clearRoundCount() {
bitField0_ &= ~0x00000001;
score = 0;
roundCount = 0;
return this;
}

/**
* <code>optional uint32 score = 2;</code>
* @return the score
* <code>optional uint32 round_count = 2;</code>
* @return the roundCount
*/
public int getScore() {
return score;
public int getRoundCount() {
return roundCount;
}

/**
* <code>optional uint32 score = 2;</code>
* @param value the score to set
* <code>optional uint32 round_count = 2;</code>
* @param value the roundCount to set
* @return this
*/
public ChallengeInfo setScore(final int value) {
public ChallengeInfo setRoundCount(final int value) {
bitField0_ |= 0x00000001;
score = value;
roundCount = value;
return this;
}

/**
* <code>optional uint32 score_two = 4;</code>
* @return whether the scoreTwo field is set
* <code>optional uint32 score = 3;</code>
* @return whether the score field is set
*/
public boolean hasScoreTwo() {
public boolean hasScore() {
return (bitField0_ & 0x00000002) != 0;
}

/**
* <code>optional uint32 score_two = 4;</code>
* <code>optional uint32 score = 3;</code>
* @return this
*/
public ChallengeInfo clearScoreTwo() {
public ChallengeInfo clearScore() {
bitField0_ &= ~0x00000002;
scoreTwo = 0;
score = 0;
return this;
}

/**
* <code>optional uint32 score_two = 4;</code>
* @return the scoreTwo
* <code>optional uint32 score = 3;</code>
* @return the score
*/
public int getScoreTwo() {
return scoreTwo;
public int getScore() {
return score;
}

/**
* <code>optional uint32 score_two = 4;</code>
* @param value the scoreTwo to set
* <code>optional uint32 score = 3;</code>
* @param value the score to set
* @return this
*/
public ChallengeInfo setScoreTwo(final int value) {
public ChallengeInfo setScore(final int value) {
bitField0_ |= 0x00000002;
scoreTwo = value;
score = value;
return this;
}

/**
* <code>optional uint32 round_count = 13;</code>
* @return whether the roundCount field is set
* <code>optional uint32 score_two = 4;</code>
* @return whether the scoreTwo field is set
*/
public boolean hasRoundCount() {
public boolean hasScoreTwo() {
return (bitField0_ & 0x00000004) != 0;
}

/**
* <code>optional uint32 round_count = 13;</code>
* <code>optional uint32 score_two = 4;</code>
* @return this
*/
public ChallengeInfo clearRoundCount() {
public ChallengeInfo clearScoreTwo() {
bitField0_ &= ~0x00000004;
roundCount = 0;
scoreTwo = 0;
return this;
}

/**
* <code>optional uint32 round_count = 13;</code>
* @return the roundCount
* <code>optional uint32 score_two = 4;</code>
* @return the scoreTwo
*/
public int getRoundCount() {
return roundCount;
public int getScoreTwo() {
return scoreTwo;
}

/**
* <code>optional uint32 round_count = 13;</code>
* @param value the roundCount to set
* <code>optional uint32 score_two = 4;</code>
* @param value the scoreTwo to set
* @return this
*/
public ChallengeInfo setRoundCount(final int value) {
public ChallengeInfo setScoreTwo(final int value) {
bitField0_ |= 0x00000004;
roundCount = value;
scoreTwo = value;
return this;
}

Expand Down Expand Up @@ -397,9 +397,9 @@ public ChallengeInfo copyFrom(final ChallengeInfo other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
roundCount = other.roundCount;
score = other.score;
scoreTwo = other.scoreTwo;
roundCount = other.roundCount;
challengeId = other.challengeId;
status = other.status;
extraLineupType = other.extraLineupType;
Expand All @@ -414,15 +414,15 @@ public ChallengeInfo mergeFrom(final ChallengeInfo other) {
return this;
}
cachedSize = -1;
if (other.hasRoundCount()) {
setRoundCount(other.roundCount);
}
if (other.hasScore()) {
setScore(other.score);
}
if (other.hasScoreTwo()) {
setScoreTwo(other.scoreTwo);
}
if (other.hasRoundCount()) {
setRoundCount(other.roundCount);
}
if (other.hasChallengeId()) {
setChallengeId(other.challengeId);
}
Expand All @@ -445,9 +445,9 @@ public ChallengeInfo clear() {
}
cachedSize = -1;
bitField0_ = 0;
roundCount = 0;
score = 0;
scoreTwo = 0;
roundCount = 0;
challengeId = 0;
status = 0;
extraLineupType = 0;
Expand Down Expand Up @@ -476,9 +476,9 @@ public boolean equals(Object o) {
}
ChallengeInfo other = (ChallengeInfo) o;
return bitField0_ == other.bitField0_
&& (!hasRoundCount() || roundCount == other.roundCount)
&& (!hasScore() || score == other.score)
&& (!hasScoreTwo() || scoreTwo == other.scoreTwo)
&& (!hasRoundCount() || roundCount == other.roundCount)
&& (!hasChallengeId() || challengeId == other.challengeId)
&& (!hasStatus() || status == other.status)
&& (!hasExtraLineupType() || extraLineupType == other.extraLineupType)
Expand All @@ -489,15 +489,15 @@ public boolean equals(Object o) {
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 16);
output.writeUInt32NoTag(score);
output.writeUInt32NoTag(roundCount);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 32);
output.writeUInt32NoTag(scoreTwo);
output.writeRawByte((byte) 24);
output.writeUInt32NoTag(score);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 104);
output.writeUInt32NoTag(roundCount);
output.writeRawByte((byte) 32);
output.writeUInt32NoTag(scoreTwo);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeRawByte((byte) 112);
Expand All @@ -521,13 +521,13 @@ public void writeTo(final ProtoSink output) throws IOException {
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(score);
size += 1 + ProtoSink.computeUInt32SizeNoTag(roundCount);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(scoreTwo);
size += 1 + ProtoSink.computeUInt32SizeNoTag(score);
}
if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(roundCount);
size += 1 + ProtoSink.computeUInt32SizeNoTag(scoreTwo);
}
if ((bitField0_ & 0x00000008) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(challengeId);
Expand All @@ -552,26 +552,26 @@ public ChallengeInfo mergeFrom(final ProtoSource input) throws IOException {
while (true) {
switch (tag) {
case 16: {
// score
score = input.readUInt32();
// roundCount
roundCount = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 32) {
if (tag != 24) {
break;
}
}
case 32: {
// scoreTwo
scoreTwo = input.readUInt32();
case 24: {
// score
score = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 104) {
if (tag != 32) {
break;
}
}
case 104: {
// roundCount
roundCount = input.readUInt32();
case 32: {
// scoreTwo
scoreTwo = input.readUInt32();
bitField0_ |= 0x00000004;
tag = input.readTag();
if (tag != 112) {
Expand Down Expand Up @@ -638,13 +638,13 @@ public ChallengeInfo mergeFrom(final ProtoSource input) throws IOException {
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.score, score);
output.writeUInt32(FieldNames.roundCount, roundCount);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.scoreTwo, scoreTwo);
output.writeUInt32(FieldNames.score, score);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeUInt32(FieldNames.roundCount, roundCount);
output.writeUInt32(FieldNames.scoreTwo, scoreTwo);
}
if ((bitField0_ & 0x00000008) != 0) {
output.writeUInt32(FieldNames.challengeId, challengeId);
Expand All @@ -668,34 +668,34 @@ public ChallengeInfo mergeFrom(final JsonSource input) throws IOException {
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 109264530: {
if (input.isAtField(FieldNames.score)) {
case -171935711:
case -244677858: {
if (input.isAtField(FieldNames.roundCount)) {
if (!input.trySkipNullValue()) {
score = input.readUInt32();
roundCount = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -485512614:
case 2129303327: {
if (input.isAtField(FieldNames.scoreTwo)) {
case 109264530: {
if (input.isAtField(FieldNames.score)) {
if (!input.trySkipNullValue()) {
scoreTwo = input.readUInt32();
score = input.readUInt32();
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
case -171935711:
case -244677858: {
if (input.isAtField(FieldNames.roundCount)) {
case -485512614:
case 2129303327: {
if (input.isAtField(FieldNames.scoreTwo)) {
if (!input.trySkipNullValue()) {
roundCount = input.readUInt32();
scoreTwo = input.readUInt32();
bitField0_ |= 0x00000004;
}
} else {
Expand Down Expand Up @@ -812,12 +812,12 @@ public ChallengeInfo create() {
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName roundCount = FieldName.forField("roundCount", "round_count");

static final FieldName score = FieldName.forField("score");

static final FieldName scoreTwo = FieldName.forField("scoreTwo", "score_two");

static final FieldName roundCount = FieldName.forField("roundCount", "round_count");

static final FieldName challengeId = FieldName.forField("challengeId", "challenge_id");

static final FieldName status = FieldName.forField("status");
Expand Down
Loading

0 comments on commit f1d3ece

Please sign in to comment.