Examples of GameMode


Examples of miagent.WorldModel.GameMode

        return decideSuperDummyStaticsSecond(trial);
    }

    /** Decide what the dynamic player should do*/
    public Actions decideDynamic() {
        GameMode mode = MIAgent.model.getCurrentGameMode();
        if (mode == WorldModel.GameMode.AGGRESSIVE) {
            if (MIAgent.enableLog) System.out.println("\t" + DecisionModule.class.getName() + "  : mode is agressive");
            return decideDynamicAggressive();
        } else if (mode == WorldModel.GameMode.ATTACK_PLAN) {
            if (MIAgent.enableLog) System.out.println("\t" + DecisionModule.class.getName() + "  : mode is ATTACK");
View Full Code Here

Examples of miagent.WorldModel.GameMode

    }

    /** Decide what the goal keeper should do*/
    public Actions decideGoalKeeper() {
        State current = MIAgent.model.getLastState();
        GameMode mode = MIAgent.model.getCurrentGameMode();

        if (mode == WorldModel.GameMode.FRIEND_GOAL_KICK) {
            if (current.getFriendGoal().getY() > 5) {
                return Actions.DASH_NORTH;
            }
View Full Code Here

Examples of miagent.WorldModel.GameMode

        return GoalKeeperAction.getAction(current);
    }

    /** Decide what the first static player should do*/
    public Actions decideStatic1() {
        GameMode mode = MIAgent.model.getCurrentGameMode();
        if (mode == WorldModel.GameMode.ATTACK_PLAN) {
            if (MIAgent.enableLog) System.out.println("\t" + DecisionModule.class.getName() + " Static 1 Action : " + attackActions[1]);
            return attackActions[1];
            // return AttackYaRab.getActions()[1];
        }
View Full Code Here

Examples of miagent.WorldModel.GameMode

    }

    /** Decide what the second static player should do*/
    public Actions decideStatic2() {
        GameMode mode = MIAgent.model.getCurrentGameMode();
        if (mode == WorldModel.GameMode.ATTACK_PLAN) {

            if (MIAgent.enableLog) System.out.println("\t" + DecisionModule.class.getName() + " Static 2 Action : " + attackActions[2]);
            return attackActions[2];
            // return AttackYaRab.getActions()[2];
View Full Code Here

Examples of miagent.WorldModel.GameMode

        }
    }

    /** Decide what the third static player should do*/
    public Actions decideStatic3() {
        GameMode mode = MIAgent.model.getCurrentGameMode();
        if (mode == WorldModel.GameMode.ATTACK_PLAN) {
            if (MIAgent.enableLog) System.out.println("\t" + DecisionModule.class.getName() + " Static 3 Action : " + attackActions[3]);
            return attackActions[3];
            //return AttackYaRab.getActions()[3];

View Full Code Here

Examples of org.bukkit.GameMode

   */
 
  public static Boolean run(CommandSender sender, String alias, String[] args) {
   
    Player target = null;
    GameMode toGM = null;
   
    if (args.length == 0){
      if (!(sender instanceof Player)){
        Commands.showCommandHelpAndUsage(sender, "cex_gm", alias);
        return true;
      }
     
      target = (Player) sender;
    }
   
    if (args.length > 3){
      Commands.showCommandHelpAndUsage(sender, "cex_gm", alias);
      return true;
    }
   
    if (args.length == 1){
      toGM = matchGM(args[0]);
      if (toGM == null){
        if (!sender.hasPermission("cex.gamemode.others")){
          LogHelper.showInfo("gamemodeOthersNoPerm", sender, ChatColor.RED);
          return true;
        }
       
        target = Bukkit.getPlayer(args[0]);
       
        if (target == null){
          LogHelper.showInfo("invalidPlayer", sender, ChatColor.RED);
          return true;
        }
      } else {
        if (!(sender instanceof Player)){
          Commands.showCommandHelpAndUsage(sender, "cex_gm", alias);
          return true;
        }
       
        target = (Player) sender;
      }
    }
   
    if (args.length == 2){
      if (!sender.hasPermission("cex.gamemode.others")){
        LogHelper.showInfo("gamemodeOthersNoPerm", sender, ChatColor.RED);
        return true;
      }
     
      target = Bukkit.getPlayer(args[0]);
      if (target == null){
        LogHelper.showInfo("invalidPlayer", sender, ChatColor.RED);
        return true;
      }
     
      toGM = matchGM(args[1]);
      if (toGM == null){
        LogHelper.showInfo("gamemodeInvalid", sender, ChatColor.RED);
        return true;
      }
    }
   
    if (toGM == null){
      if (target.getGameMode() == GameMode.SURVIVAL){
        toGM = GameMode.CREATIVE;
      } else {
        toGM = GameMode.SURVIVAL;
      }
    }
   
   
    target.setGameMode(toGM);
    if (sender != target){
      LogHelper.showInfo("gamemodeToSender#####[" + Nicknames.getNick(target.getName()) + " #####to#####[" + Utils.userFriendlyNames(toGM.name()), sender, ChatColor.AQUA);
      LogHelper.showInfo("gamemodeNotify#####[" + Nicknames.getNick(sender.getName()) + " #####to#####[" + Utils.userFriendlyNames(toGM.name()), target, ChatColor.AQUA);
    } else {
      LogHelper.showInfo("gamemodeSelf#####[" + Utils.userFriendlyNames(toGM.name()), sender, ChatColor.AQUA);
    }
   
    return true;
  }
View Full Code Here

Examples of org.bukkit.GameMode

   
    return true;
  }
 
  public static GameMode matchGM(String input){
    GameMode gamemode = null;
   
    if (input.matches(CommandsEX.intRegex)){
      int intValue = Integer.valueOf(input);
      for (GameMode gm : GameMode.values()){
        if (gm.getValue() == intValue){
View Full Code Here

Examples of org.bukkit.GameMode

       
        final BlockBreakConfig cc = BlockBreakConfig.getConfig(player);
        final BlockBreakData data = BlockBreakData.getData(player);
        final long now = System.currentTimeMillis();
       
        final GameMode gameMode = player.getGameMode();
       
        // Has the player broken a block that was not damaged before?
        if (wrongBlock.isEnabled(player) && wrongBlock.check(player, block, cc, data, isInstaBreak)) {
          cancelled = true;
        }
View Full Code Here

Examples of org.bukkit.GameMode

        try {
            value = Integer.parseInt(modeArg);
        } catch (NumberFormatException ex) {}

        GameMode mode = GameMode.getByValue(value);

        if (mode == null) {
            if (modeArg.equalsIgnoreCase("creative") || modeArg.equalsIgnoreCase("c")) {
                mode = GameMode.CREATIVE;
            } else if (modeArg.equalsIgnoreCase("adventure") || modeArg.equalsIgnoreCase("a")) {
                mode = GameMode.ADVENTURE;
            } else {
                mode = GameMode.SURVIVAL;
            }
        }

        Bukkit.getServer().setDefaultGameMode(mode);
        Command.broadcastCommandMessage(sender, "Default game mode set to " + mode.toString().toLowerCase());

        return true;
    }
View Full Code Here

Examples of org.bukkit.GameMode

            try {
                value = Integer.parseInt(modeArg);
            } catch (NumberFormatException ex) {}

            GameMode mode = GameMode.getByValue(value);

            if (mode == null) {
                if (modeArg.equalsIgnoreCase("creative") || modeArg.equalsIgnoreCase("c")) {
                    mode = GameMode.CREATIVE;
                } else if (modeArg.equalsIgnoreCase("adventure") || modeArg.equalsIgnoreCase("a")) {
                    mode = GameMode.ADVENTURE;
                } else {
                    mode = GameMode.SURVIVAL;
                }
            }

            if (mode != player.getGameMode()) {
                player.setGameMode(mode);

                if (mode != player.getGameMode()) {
                    sender.sendMessage("Game mode change for " + player.getName() + " failed!");
                } else {
                    if (player == sender) {
                        Command.broadcastCommandMessage(sender, "Set own game mode to " + mode.toString() + " mode");
                    } else {
                        Command.broadcastCommandMessage(sender, "Set " + player.getName() + "'s game mode to " + mode.toString() + " mode");
                    }
                }
            } else {
                sender.sendMessage(player.getName() + " already has game mode " + mode.getValue());
            }
        } else {
            sender.sendMessage("Can't find player " + playerArg);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.