GUI: lobby - improved details info about match (#11438)

This commit is contained in:
ssk97 2023-12-09 04:35:09 -08:00 committed by GitHub
parent 414699f7d4
commit 6cd8649857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 148 additions and 108 deletions

View file

@ -10,23 +10,21 @@ package mage.constants;
* @author alexander-novo
*/
public enum MatchBufferTime {
NONE(0, "None"),
SEC__01(1, "1 Second"),
SEC__02(2, "2 Seconds"),
SEC__03(3, "3 Seconds"),
SEC__05(5, "5 Seconds"),
SEC__10(10, "10 Seconds"),
SEC__15(15, "15 Seconds"),
SEC__20(20, "20 Seconds"),
SEC__25(25, "25 Seconds"),
SEC__30(30, "30 Seconds");
NONE(0),
SEC__01(1),
SEC__02(2),
SEC__03(3),
SEC__05(5),
SEC__10(10),
SEC__15(15),
SEC__20(20),
SEC__25(25),
SEC__30(30);
private final int bufferSecs;
private final String name;
MatchBufferTime(int bufferSecs, String name) {
MatchBufferTime(int bufferSecs) {
this.bufferSecs = bufferSecs;
this.name = name;
}
public int getBufferSecs() {
@ -34,11 +32,25 @@ public enum MatchBufferTime {
}
public String getName() {
return name;
if (this == NONE){
return "None";
} else if (this == SEC__01){
return "1 Second";
} else {
return bufferSecs + " Seconds";
}
}
@Override
public String toString() {
return name;
return getName();
}
public String getShortName() {
if (this == NONE){
return "None";
} else {
return bufferSecs + "s";
}
}
}

View file

@ -7,27 +7,25 @@ package mage.constants;
* @author LevelX2
*/
public enum MatchTimeLimit {
NONE(0,"None"),
MIN__10(600, "10 Minutes"),
MIN__15(900, "15 Minutes"),
MIN__20(1200, "20 Minutes"),
MIN__25(1500, "25 Minutes"),
MIN__30(1800, "30 Minutes"),
MIN__35(2100, "35 Minutes"),
MIN__40(2400, "40 Minutes"),
MIN__45(2700, "45 Minutes"),
MIN__50(3000, "50 Minutes"),
MIN__55(3300, "55 Minutes"),
MIN__60(3600, "60 Minutes"),
MIN__90(5400, "90 Minutes"),
MIN_120(7200, "120 Minutes");
NONE(0),
MIN__10(600),
MIN__15(900),
MIN__20(1200),
MIN__25(1500),
MIN__30(1800),
MIN__35(2100),
MIN__40(2400),
MIN__45(2700),
MIN__50(3000),
MIN__55(3300),
MIN__60(3600),
MIN__90(5400),
MIN_120(7200);
private final int prioritySecs;
private final String name;
MatchTimeLimit(int prioritySecs, String name) {
MatchTimeLimit(int prioritySecs) {
this.prioritySecs = prioritySecs;
this.name = name;
}
public int getPrioritySecs() {
@ -35,11 +33,23 @@ public enum MatchTimeLimit {
}
public String getName() {
return name;
if (this == NONE){
return "None";
} else {
return (prioritySecs/60)+" Minutes";
}
}
@Override
public String toString() {
return name;
return getName();
}
public String getShortName() {
if (this == NONE){
return "None";
} else {
return (prioritySecs/60) + "m";
}
}
}