Skip to content

Commit

Permalink
did some code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkohout committed Dec 12, 2022
1 parent f79f7f1 commit cbd20cd
Show file tree
Hide file tree
Showing 18 changed files with 157 additions and 169 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

group = 'io.github.robocup-logistics'
archivesBaseName = "java-sdk"
version = '0.1.9.6'
version = '0.1.10'

description = ""

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/rcll/domain/CapStationInstruction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.rcll.domain;

public enum CapStationInstruction {
RetrieveCap,
MountCap
}
5 changes: 5 additions & 0 deletions src/main/java/com/rcll/domain/Machine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.rcll.domain;

public enum Machine {
BS, DS, RS1, RS2, CS1, CS2, SS;
}
92 changes: 0 additions & 92 deletions src/main/java/com/rcll/domain/MachineClientUtils.java

This file was deleted.

16 changes: 8 additions & 8 deletions src/main/java/com/rcll/domain/MachineName.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,31 @@ public boolean isStorageStation() {
return this.rawMachineName.contains("SS");
}

public MachineClientUtils.Machine asMachineEnum() {
public Machine asMachineEnum() {
if (isBaseStation()) {
return MachineClientUtils.Machine.BS;
return Machine.BS;
}
if (isDeliveryStation()) {
return MachineClientUtils.Machine.DS;
return Machine.DS;
}
if (isRingStation()) {
if (this.rawMachineName.contains("1")) {
return MachineClientUtils.Machine.RS1;
return Machine.RS1;
}
if (this.rawMachineName.contains("2")) {
return MachineClientUtils.Machine.RS2;
return Machine.RS2;
}
}
if (isCapStation()) {
if (this.rawMachineName.contains("1")) {
return MachineClientUtils.Machine.CS1;
return Machine.CS1;
}
if (this.rawMachineName.contains("2")) {
return MachineClientUtils.Machine.CS2;
return Machine.CS2;
}
}
if (isStorageStation()) {
return MachineClientUtils.Machine.SS;
return Machine.SS;
}
throw new RuntimeException("Unkonwn Machine: " + this.rawMachineName);
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/rcll/domain/MachineSide.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.rcll.domain;

public enum MachineSide {
Input,
Output
}
13 changes: 13 additions & 0 deletions src/main/java/com/rcll/domain/MachineState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.rcll.domain;
public enum MachineState {
READY_AT_OUTPUT,
IDLE,
WAIT_IDLE,
DOWN,
BROKEN,
PREPARED,
PROCESSING,
PROCESSED,
AVAILABLE,
UNDEFINED
}
10 changes: 5 additions & 5 deletions src/main/java/com/rcll/domain/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public class Order {
private Base base;
private boolean competitive;

public Complexity getComplexity() {
public ProductComplexity getComplexity() {
if (ring3 != null) {
return Complexity.C3;
return ProductComplexity.C3;
}
if (ring2 != null) {
return Complexity.C2;
return ProductComplexity.C2;
}
if (ring1 != null) {
return Complexity.C1;
return ProductComplexity.C1;
}
return Complexity.C0;
return ProductComplexity.C0;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.rcll.domain;

public enum Complexity {
public enum ProductComplexity {
C0,
C1,
C2,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rcll/domain/Ring.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Setter
@AllArgsConstructor
public class Ring {
MachineClientUtils.Machine machine;
MachineClientUtils.RingColor color;
Machine machine;
RingColor color;
int rawMaterial;
}
8 changes: 8 additions & 0 deletions src/main/java/com/rcll/domain/RingColor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.rcll.domain;

public enum RingColor {
Blue,
Green,
Orange,
Yellow
}
Loading

0 comments on commit cbd20cd

Please sign in to comment.