Re-did how OnCommand works in AliPresents

Removed CommandSender sender for all Player and Mod Commands, replaced
with Player player
This commit is contained in:
alisolarflare 2016-11-24 21:48:10 -05:00
parent 1554f3f2f0
commit 63a6c775a4
24 changed files with 213 additions and 245 deletions

View file

@ -1,11 +1,6 @@
package alisolarflare.components; package alisolarflare.components;
import org.bukkit.command.CommandSender; public abstract class ModCommand extends PlayerCommand{
public abstract class ModCommand extends BaseCommand{
@Override
public abstract boolean OnCommand(CommandSender sender, String alias, String[] args);
@Override @Override
public String[] GetHelpText(String alias){ public String[] GetHelpText(String alias){
@ -15,12 +10,6 @@ public abstract class ModCommand extends BaseCommand{
}; };
} }
@Override
public boolean GetPlayerOnly() {
// TODO Auto-generated method stub
return true;
}
@Override @Override
public boolean GetModOnly() { public boolean GetModOnly() {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View file

@ -1,6 +1,14 @@
package alisolarflare.components; package alisolarflare.components;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public abstract class PlayerCommand extends BaseCommand{ public abstract class PlayerCommand extends BaseCommand{
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args){
return OnCommand((Player) sender, alias, args);
}
public abstract boolean OnCommand(Player player, String alias, String[] args);
@Override @Override
public boolean GetPlayerOnly() { public boolean GetPlayerOnly() {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View file

@ -1,15 +1,15 @@
package alisolarflare.components.bankchest; package alisolarflare.components.bankchest;
import org.bukkit.command.CommandSender; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
public class CreateBankChest extends ModCommand { public class CreateBankChest extends ModCommand {
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
} }

View file

@ -3,7 +3,6 @@ package alisolarflare.components.creativeboundaries.commands;
import java.util.List; import java.util.List;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
@ -18,13 +17,7 @@ public class Cbgm0 extends PlayerCommand{
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
if (!(sender instanceof Player)){
sender.sendMessage("You must be a player to use this command!");
return false;
}
Player player = (Player) sender;
player.setGameMode(GameMode.SURVIVAL); player.setGameMode(GameMode.SURVIVAL);
cbCreatives.remove(player); cbCreatives.remove(player);
return true; return true;

View file

@ -3,7 +3,6 @@ package alisolarflare.components.creativeboundaries.commands;
import java.util.List; import java.util.List;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
@ -24,10 +23,7 @@ public class Cbgm1 extends PlayerCommand {
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
Player player = (Player) sender;
TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); TownBlock tb = TownyUniverse.getTownBlock(player.getLocation());
if (tb == null) { if (tb == null) {

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands; package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
public class ActivatePowers extends ModCommand{ public class ActivatePowers extends ModCommand{
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
return false; return false;
} }
} }

View file

@ -1,6 +1,5 @@
package alisolarflare.components.flairdoor.commands; package alisolarflare.components.flairdoor.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
@ -13,9 +12,9 @@ public class FlairMe extends PlayerCommand {
this.component = flairDoorComponent; this.component = flairDoorComponent;
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String label, String[] args) { public boolean OnCommand(Player player, String label, String[] args) {
component.playersToBeFlaired.add((Player) sender); component.playersToBeFlaired.add(player);
sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); player.sendMessage("Setup Successful! Walk through a portal to get your flair");
return true; return true;
} }
@Override @Override

View file

@ -1,6 +1,5 @@
package alisolarflare.components.gpowers.commands; package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
@ -15,8 +14,7 @@ public class GPower extends PlayerCommand {
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String label, String[] args) { public boolean OnCommand(Player player, String label, String[] args) {
Player player = (Player) sender;
if (args.length < 2) { if (args.length < 2) {
player.sendMessage("Proper Usage to test G-Powers:"); player.sendMessage("Proper Usage to test G-Powers:");
player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]");

View file

@ -1,7 +1,6 @@
package alisolarflare.components.insurance; package alisolarflare.components.insurance;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -11,9 +10,7 @@ public class getInsurance extends ModCommand {
private final int defaultAmount = 1; private final int defaultAmount = 1;
private final InsuranceType defaultInsuranceType = InsuranceType.Block; private final InsuranceType defaultInsuranceType = InsuranceType.Block;
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
Player player = (Player) sender;
int amount = defaultAmount; int amount = defaultAmount;
InsuranceType insuranceType = defaultInsuranceType; InsuranceType insuranceType = defaultInsuranceType;

View file

@ -1,7 +1,6 @@
package alisolarflare.components.insurance; package alisolarflare.components.insurance;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType;
public class getInsuranceBar extends ModCommand { public class getInsuranceBar extends ModCommand {
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
Player player = (Player) sender;
if (args.length > 0 && StringUtils.isNumeric(args[0])){ if (args.length > 0 && StringUtils.isNumeric(args[0])){
player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0])));
}else{ }else{

View file

@ -1,7 +1,6 @@
package alisolarflare.components.insurance; package alisolarflare.components.insurance;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType;
public class getInsuranceBlock extends ModCommand { public class getInsuranceBlock extends ModCommand {
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
Player player = (Player) sender;
if (args.length > 0 && StringUtils.isNumeric(args[0])){ if (args.length > 0 && StringUtils.isNumeric(args[0])){
player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0])));
}else{ }else{

View file

@ -1,7 +1,6 @@
package alisolarflare.components.insurance; package alisolarflare.components.insurance;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType;
public class getInsuranceNugget extends ModCommand { public class getInsuranceNugget extends ModCommand {
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
Player player = (Player) sender;
if (args.length > 0 && StringUtils.isNumeric(args[0])){ if (args.length > 0 && StringUtils.isNumeric(args[0])){
player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0])));
}else{ }else{

View file

@ -1,6 +1,5 @@
package alisolarflare.components.magic.tricks; package alisolarflare.components.magic.tricks;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -11,12 +10,7 @@ public class BoomBowRule extends ModCommand{
public static boolean endCrystal; public static boolean endCrystal;
public static boolean localized;; public static boolean localized;;
@Override @Override
public boolean OnCommand(CommandSender sender, String label, String[] args) { public boolean OnCommand(Player player, String label, String[] args) {
if (sender instanceof Player == false){
sender.sendMessage("You must be a player to use this command");
return false;
}
Player player = (Player) sender;
if (player.getName().equals("alisolarflare") == false){ if (player.getName().equals("alisolarflare") == false){
player.sendMessage("You must be alisolarflare to use this command"); player.sendMessage("You must be alisolarflare to use this command");
return false; return false;

View file

@ -1,6 +1,5 @@
package alisolarflare.components.metrics.commands; package alisolarflare.components.metrics.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand; import alisolarflare.components.ModCommand;
@ -15,11 +14,13 @@ public class GetLoginMetrics extends ModCommand{
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
Player player = (Player) sender;
for (String metric : module.metricsList){ for (String metric : module.metricsList){
player.sendMessage(metric); player.sendMessage(metric);
} }
if (args.length < 1){
return true;
}
return true; return true;
} }
} }

View file

@ -1,6 +1,6 @@
package alisolarflare.components.minigames.commands; package alisolarflare.components.minigames.commands;
import org.bukkit.command.CommandSender; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
import alisolarflare.components.minigames.MinigameComponent; import alisolarflare.components.minigames.MinigameComponent;
@ -13,17 +13,17 @@ public class JoinMinigame extends PlayerCommand {
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
String name = sender.getName(); String name = player.getName();
if (module.fighters.contains(name)) { if (module.fighters.contains(name)) {
sender.sendMessage("You are already in the minigame!"); player.sendMessage("You are already in the minigame!");
return true; return true;
} }
module.fighters.add(name); module.fighters.add(name);
if (module.fighters.contains(name)) { if (module.fighters.contains(name)) {
sender.sendMessage("You have joined the minigame!"); player.sendMessage("You have joined the minigame!");
} }
return true; return true;
} }

View file

@ -1,6 +1,5 @@
package alisolarflare.components.minigames.commands; package alisolarflare.components.minigames.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
@ -15,21 +14,21 @@ public class LeaveMinigame extends PlayerCommand {
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
if(!(sender instanceof Player)) if(!(player instanceof Player))
sender.sendMessage("You must be a player to use this command!"); player.sendMessage("You must be a player to use this command!");
String name = sender.getName(); String name = player.getName();
if (!(module.fighters.contains(name))) { if (!(module.fighters.contains(name))) {
sender.sendMessage("You are not fighting!"); player.sendMessage("You are not fighting!");
return true; return true;
} }
while(module.fighters.contains(name)){ while(module.fighters.contains(name)){
module.fighters.remove(name); module.fighters.remove(name);
} }
sender.sendMessage("You have left the fighters category!"); player.sendMessage("You have left the fighters category!");
return true; return true;
} }

View file

@ -1,6 +1,6 @@
package alisolarflare.components.minigames.commands; package alisolarflare.components.minigames.commands;
import org.bukkit.command.CommandSender; import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand; import alisolarflare.components.PlayerCommand;
import alisolarflare.components.minigames.MinigameComponent; import alisolarflare.components.minigames.MinigameComponent;
@ -13,8 +13,8 @@ public class ListFighters extends PlayerCommand {
} }
@Override @Override
public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
sender.sendMessage(lobby.fighters.toString()); player.sendMessage(lobby.fighters.toString());
return true; return true;
} }
@Override @Override

View file

@ -1,55 +1,55 @@
package graveyard.autouhc.idle; //package graveyard.autouhc.idle;
//
import org.bukkit.command.CommandSender; //import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; //import org.bukkit.entity.Player;
//
import alisolarflare.components.ModCommand; //import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.UHCMatch; //import graveyard.autouhc.memory.UHCMatch;
//
/** ///**
* This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} // * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)}
* // *
* @author Alisolarflare // * @author Alisolarflare
*/ // */
/**@deprecated*/ ///**@deprecated*/
public class AddToUHC extends ModCommand { //public class AddToUHC extends ModCommand {
private UHCMatch match; // private UHCMatch match;
//
public AddToUHC(UHCMatch match) { // public AddToUHC(UHCMatch match) {
this.match = match; // this.match = match;
} // }
//
@Override // @Override
public boolean OnCommand(CommandSender sender, String label, String[] args) { // public boolean OnCommand(CommandSender sender, String label, String[] args) {
// INPUT SANITATION // // INPUT SANITATION
Player player = (Player) sender; // Player player = (Player) sender;
if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { // if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) {
sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); // sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions");
return false; // return false;
} // }
if (args.length <= 1) { // if (args.length <= 1) {
sender.sendMessage("You must supply at least one playername"); // sender.sendMessage("You must supply at least one playername");
} // }
//
switch(match.getMatchState()){ // switch(match.getMatchState()){
case IDLE: // case IDLE:
case WAITING: // case WAITING:
case SETUP: // case SETUP:
case INTRO: // case INTRO:
// Adds players to memory // // Adds players to memory
sender.sendMessage("Adding Players to matchList!"); // sender.sendMessage("Adding Players to matchList!");
for (int i = 0; i > args.length; i++) { // for (int i = 0; i > args.length; i++) {
match.getPlayerList().add(args[i]); // match.getPlayerList().add(args[i]);
}sender.sendMessage("Finished!"); // }sender.sendMessage("Finished!");
case PEACE: // case PEACE:
case TENSION: // case TENSION:
case POWER: // case POWER:
case END: // case END:
sender.sendMessage("There is already a match going on!"); // sender.sendMessage("There is already a match going on!");
} // }
//
//
//
return false; // return false;
} // }
} //}

View file

@ -1,48 +1,48 @@
package graveyard.autouhc.idle; //package graveyard.autouhc.idle;
//
import org.bukkit.command.CommandSender; //import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; //import org.bukkit.entity.Player;
//
import alisolarflare.components.ModCommand; //import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.UHCMatch; //import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/ ///**@deprecated*/
public class JoinUHC extends ModCommand{ //public class JoinUHC extends ModCommand{
//
private UHCMatch match; // private UHCMatch match;
//
public JoinUHC(UHCMatch match) { // public JoinUHC(UHCMatch match) {
this.match = match; // this.match = match;
} // }
//
@Override // @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { // public boolean OnCommand(CommandSender sender, String alias, String[] args) {
if (!(sender instanceof Player)) // if (!(sender instanceof Player))
return false; // return false;
Player player = (Player) sender; // Player player = (Player) sender;
player.sendMessage("Adding you to the UltraHardcore match!"); // player.sendMessage("Adding you to the UltraHardcore match!");
switch(match.getMatchState()){ // switch(match.getMatchState()){
//
//Before the game // //Before the game
case IDLE: // case IDLE:
case WAITING: // case WAITING:
case SETUP: // case SETUP:
case INTRO: // case INTRO:
player.sendMessage("Adding you to the UltraHardcore match!"); // player.sendMessage("Adding you to the UltraHardcore match!");
match.getPlayerList().add(player.getName()); // match.getPlayerList().add(player.getName());
break; // break;
//
//During the game // //During the game
case PEACE: // case PEACE:
case TENSION: // case TENSION:
case POWER: // case POWER:
player.sendMessage("There is currently an UltraHardcore match going on! #POINTTOSPECTATORMODE, tell Ali asap if you see this"); // player.sendMessage("There is currently an UltraHardcore match going on! #POINTTOSPECTATORMODE, tell Ali asap if you see this");
//
//After the game // //After the game
case END: // case END:
player.sendMessage("There is currently an ending ceremony going on! #POINTTOCEREMONY, tell Ali ASAP if you see this"); // player.sendMessage("There is currently an ending ceremony going on! #POINTTOCEREMONY, tell Ali ASAP if you see this");
//
} // }
//
return false; // return false;
} // }
} //}

View file

@ -1,19 +1,19 @@
package graveyard.autouhc.intro; //package graveyard.autouhc.intro;
//
import org.bukkit.command.CommandSender; //import org.bukkit.command.CommandSender;
//
import alisolarflare.components.ModCommand; //import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.UHCMatch; //import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/ ///**@deprecated*/
public class ConfigureMatch extends ModCommand{ //public class ConfigureMatch extends ModCommand{
//
public ConfigureMatch(UHCMatch match) { // public ConfigureMatch(UHCMatch match) {
// TODO Auto-generated constructor stub // // TODO Auto-generated constructor stub
} // }
//
@Override // @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) { // public boolean OnCommand(CommandSender sender, String alias, String[] args) {
// TODO Auto-generated method stub // // TODO Auto-generated method stub
return false; // return false;
} // }
} //}

View file

@ -1,5 +1,5 @@
package graveyard.autouhc.intro; //package graveyard.autouhc.intro;
/**@deprecated*/ ///**@deprecated*/
public class IntroductionCutscene { //public class IntroductionCutscene {
//TODO: Teleport all players to the area. // //TODO: Teleport all players to the area.
} //}

View file

@ -1,19 +1,19 @@
package graveyard.autouhc.listeners; //package graveyard.autouhc.listeners;
//
import org.bukkit.event.Listener; //import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin; //import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask; //import org.bukkit.scheduler.BukkitTask;
//
/** ///**
* Main launcher for the repeating task that activates the // * Main launcher for the repeating task that activates the
* ghostie powers if an Ultrahardcore Match is going on, // * ghostie powers if an Ultrahardcore Match is going on,
* and it's time for powers to activate // * and it's time for powers to activate
*/ // */
/**@deprecated*/ ///**@deprecated*/
public class MatchCyclingListener implements Listener { //public class MatchCyclingListener implements Listener {
public BukkitTask PowerCyclingTask; // public BukkitTask PowerCyclingTask;
//
public MatchCyclingListener(JavaPlugin plugin){ // public MatchCyclingListener(JavaPlugin plugin){
PowerCyclingTask = (new MatchMainLoop()).runTaskTimer(plugin, 20, 20); // PowerCyclingTask = (new MatchMainLoop()).runTaskTimer(plugin, 20, 20);
} // }
} //}

View file

@ -1,12 +1,12 @@
package graveyard.autouhc.listeners; //package graveyard.autouhc.listeners;
//
import org.bukkit.scheduler.BukkitRunnable; //import org.bukkit.scheduler.BukkitRunnable;
/**@deprecated*/ ///**@deprecated*/
public class MatchMainLoop extends BukkitRunnable{ //public class MatchMainLoop extends BukkitRunnable{
@Override // @Override
public void run() { // public void run() {
//
} // }
//
//
} //}

View file

@ -1,12 +1,12 @@
package graveyard.autouhc.memory; //package graveyard.autouhc.memory;
/**@deprecated*/ ///**@deprecated*/
public enum MatchState { //public enum MatchState {
IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match // IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match
WAITING, //SETUP: Scheduled Time, INTRO: No Setup // WAITING, //SETUP: Scheduled Time, INTRO: No Setup
SETUP, //INTRO: Done // SETUP, //INTRO: Done
INTRO, //Peace: Done, and players ready // INTRO, //Peace: Done, and players ready
PEACE, //Tension: Timer, End: All dead // PEACE, //Tension: Timer, End: All dead
TENSION, //Power: Timer, End: All dead // TENSION, //Power: Timer, End: All dead
POWER, //End: All dead // POWER, //End: All dead
END//IDLE: Ceremony over // END//IDLE: Ceremony over
} //}