@@ -1,30 +1,30 @@
package graveyard.autouhc;
import org.bukkit.plugin.java.JavaPlugin;

import alisolarflare.components.Component;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;

/**@deprecated*/
public class UHCModule extends Component {
public UHCMatch match;

public void register(JavaPlugin plugin) {


if (plugin.getConfig().contains("UHCMatchState")){
match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState")));
}else{
match = new UHCMatch(plugin.getConfig(), MatchState.IDLE);
}


//registerCommand(plugin, new SetMatchState(match));
//registerCommand(plugin, new AddToUHC(match));
//registerCommand(plugin, new JoinUHC(match));
//registerCommand(plugin, new StartMatch(match));
//registerCommand(plugin, new ConfigureMatch(match));
//registerCommand(plugin, new ScheduleMatch(match));

}
}
//package graveyard.autouhc;
//import org.bukkit.plugin.java.JavaPlugin;
//
//import alisolarflare.components.Component;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
//
///**@deprecated*/
//public class UHCModule extends Component {
// public UHCMatch match;
//
// public void register(JavaPlugin plugin) {
//
//
// if (plugin.getConfig().contains("UHCMatchState")){
// match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState")));
// }else{
// match = new UHCMatch(plugin.getConfig(), MatchState.IDLE);
// }
//
//
// //registerCommand(plugin, new SetMatchState(match));
// //registerCommand(plugin, new AddToUHC(match));
// //registerCommand(plugin, new JoinUHC(match));
// //registerCommand(plugin, new StartMatch(match));
// //registerCommand(plugin, new ConfigureMatch(match));
// //registerCommand(plugin, new ScheduleMatch(match));
//
// }
//}
@@ -1,71 +1,71 @@
package graveyard.autouhc.controller;

import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class SetMatchState extends ModCommand{

UHCMatch match;
public SetMatchState(UHCMatch match) {
this.match = match;
}

@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
if (!(sender instanceof Player)){
sender.sendMessage("You must be a player to use this command!");
return false;
}

Player player = (Player) sender;

if (player.getName().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){
sender.sendMessage("You must be either Ali or Arsen to use this command!");
return false;
}


if(args.length < 1 ){
player.sendMessage("Usage: /setMatchState [stateToBeSet]");
player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
return false;
}

String inputState = args[0];
boolean inputIsValidState = false;
for (MatchState defaultMatchState : MatchState.values()){
if(inputState.equalsIgnoreCase(defaultMatchState.toString())){
inputIsValidState = true;
}
}

if (inputIsValidState){
match.setMatchState(MatchState.valueOf(inputState));
player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!");
}else{
player.sendMessage("Error, could not parse state.");
player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
return false;
}


return false;
}

@Override
public boolean GetPlayerOnly() {
// TODO Auto-generated method stub
return true;
}

@Override
public boolean GetModOnly() {
// TODO Auto-generated method stub
return false;
}

}
//package graveyard.autouhc.controller;
//
//import org.bukkit.command.CommandSender;
//import org.bukkit.entity.Player;
//
//import alisolarflare.components.ModCommand;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
///**@deprecated*/
//public class SetMatchState extends ModCommand{
//
// UHCMatch match;
// public SetMatchState(UHCMatch match) {
// this.match = match;
// }
//
// @Override
// public boolean OnCommand(CommandSender sender, String alias, String[] args) {
// if (!(sender instanceof Player)){
// sender.sendMessage("You must be a player to use this command!");
// return false;
// }
//
// Player player = (Player) sender;
//
// if (player.getName().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){
// sender.sendMessage("You must be either Ali or Arsen to use this command!");
// return false;
// }
//
//
// if(args.length < 1 ){
// player.sendMessage("Usage: /setMatchState [stateToBeSet]");
// player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
// return false;
// }
//
// String inputState = args[0];
// boolean inputIsValidState = false;
// for (MatchState defaultMatchState : MatchState.values()){
// if(inputState.equalsIgnoreCase(defaultMatchState.toString())){
// inputIsValidState = true;
// }
// }
//
// if (inputIsValidState){
// match.setMatchState(MatchState.valueOf(inputState));
// player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!");
// }else{
// player.sendMessage("Error, could not parse state.");
// player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
// return false;
// }
//
//
// return false;
// }
//
// @Override
// public boolean GetPlayerOnly() {
// // TODO Auto-generated method stub
// return true;
// }
//
// @Override
// public boolean GetModOnly() {
// // TODO Auto-generated method stub
// return false;
// }
//
//}
@@ -1,19 +1,19 @@
package graveyard.autouhc.intro;

import org.bukkit.command.CommandSender;

import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class ScheduleMatch extends ModCommand{

public ScheduleMatch(UHCMatch match) {
// TODO Auto-generated constructor stub
}

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

import org.bukkit.command.CommandSender;

import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;

/**@deprecated*/
public class StartMatch extends ModCommand {
private UHCMatch match;
/**@deprecated*/
public StartMatch(UHCMatch match) {
this.match = match;
}

@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {

if (!sender.hasPermission("moderator") && !(sender.getName() == ""))
sender.sendMessage("You must be a moderator or Arsenalis to use this command! "
+ "Contact a TBMC dev if you think this is wrong");

//ACTIVATES MATCH
switch(match.getMatchState()){
case IDLE:
sender.sendMessage("There is currently a match ready... Activating...");
match.setMatchState(MatchState.INTRO);
break;

case WAITING:
sender.sendMessage("There currently a match planned for: TIME:TIME:TIME");
break;

case END:
sender.sendMessage("The match has ended! Would you like to restart using current settings?");
break;

default:
sender.sendMessage("You cannot start a match now, one is already in progress!");
}

return false;


}

@Override
public String GetCommandPath() {
return "startmatch";
}
}
//package graveyard.autouhc.intro;
//
//import org.bukkit.command.CommandSender;
//
//import alisolarflare.components.ModCommand;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
//
///**@deprecated*/
//public class StartMatch extends ModCommand {
// private UHCMatch match;
// /**@deprecated*/
// public StartMatch(UHCMatch match) {
// this.match = match;
// }
//
// @Override
// public boolean OnCommand(CommandSender sender, String label, String[] args) {
//
// if (!sender.hasPermission("moderator") && !(sender.getName() == ""))
// sender.sendMessage("You must be a moderator or Arsenalis to use this command! "
// + "Contact a TBMC dev if you think this is wrong");
//
// //ACTIVATES MATCH
// switch(match.getMatchState()){
// case IDLE:
// sender.sendMessage("There is currently a match ready... Activating...");
// match.setMatchState(MatchState.INTRO);
// break;
//
// case WAITING:
// sender.sendMessage("There currently a match planned for: TIME:TIME:TIME");
// break;
//
// case END:
// sender.sendMessage("The match has ended! Would you like to restart using current settings?");
// break;
//
// default:
// sender.sendMessage("You cannot start a match now, one is already in progress!");
// }
//
// return false;
//
//
// }
//
// @Override
// public String GetCommandPath() {
// return "startmatch";
// }
//}
@@ -1,51 +1,51 @@
package graveyard.autouhc.memory;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;

/**@deprecated*/
public class UHCMatch {
private FileConfiguration config;
private MatchState matchState = MatchState.IDLE;
private List<String> playerList = new ArrayList<String>();

private Location lobbyLocation;
public UHCMatch(FileConfiguration fileConfiguration, MatchState state) {
this.config = fileConfiguration;
this.matchState = state;
}

public MatchState getMatchState(){
return matchState;
}

public void setMatchState(MatchState newMS){
matchState = newMS;
config.set("UHCMatchState", newMS.toString());
switch(newMS){
default:
break;
}
}

public List<String> getPlayerList() {
return playerList;
}

public void setPlayerList(List<String> playerList) {
this.playerList = playerList;
}

public Location getLobbyLocation() {

return lobbyLocation;
}

public void setLobbyLocation(Location lobbyLocation) {
this.lobbyLocation = lobbyLocation;
}

}
//package graveyard.autouhc.memory;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import org.bukkit.Location;
//import org.bukkit.configuration.file.FileConfiguration;
//
///**@deprecated*/
//public class UHCMatch {
// private FileConfiguration config;
// private MatchState matchState = MatchState.IDLE;
// private List<String> playerList = new ArrayList<String>();
//
// private Location lobbyLocation;
// public UHCMatch(FileConfiguration fileConfiguration, MatchState state) {
// this.config = fileConfiguration;
// this.matchState = state;
// }
//
// public MatchState getMatchState(){
// return matchState;
// }
//
// public void setMatchState(MatchState newMS){
// matchState = newMS;
// config.set("UHCMatchState", newMS.toString());
// switch(newMS){
// default:
// break;
// }
// }
//
// public List<String> getPlayerList() {
// return playerList;
// }
//
// public void setPlayerList(List<String> playerList) {
// this.playerList = playerList;
// }
//
// public Location getLobbyLocation() {
//
// return lobbyLocation;
// }
//
// public void setLobbyLocation(Location lobbyLocation) {
// this.lobbyLocation = lobbyLocation;
// }
//
//}