Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.aale.samuraisiegehackmaven;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author aale
* created on Apr 5, 2017, 7:55:12 PM
*/
public class GameConfig {
static int gameX1 = 515;
static int gameY1 = 31;
static int gameX2 = 1365;
static int gameY2 = 510;
static int inner_gameX1 = 676;
static int inner_gameY1 = 132;
static int inner_gameX2 = 1310;
static int inner_gameY2 = 420;
final static String HISTORY_B = "history_button";
final static String REWARD_B = "reward_button";
final static String CLAIM_B = "claim_button";
final static String DIAMOND_B = "diamond_button";
final static String CONTINUE_B = "continue_button";
final static String BATTLE_B = "battle_button";
final static String BATTLE2_B = "battle_2_button";
final static String WITHDRAW_B = "withdraw_button";
final static String NO_B = "no_button";
final static String CENTER_A = "center_area";
final static String ROSHA_B = "roshamon_button";
final static String CAMP_B = "camp_button";
final static String CONTINUE_AFTER_GAME_B = "continue_after_game_button";
final static String RETREAT_B = "retreat_button";
final static String RETREAT_CONFIRM_B = "retreat_confirm_button";
final static String NEXT_BATTLE_B = "next_battle_button";
final static String EXIT_GAME_B = "exit_game_button";
final static String ANDROID_APP_B = "android_app_button";
final static String SS_ICON = "samurai_siege_icon";
final static String BATTLE_ANYWAY_B = "battle_anyway_button";
final static String REALLY_QUIT_NO_B = "really_quit_no_button";
final static String REALLY_QUIT_YES_B = "really_quit_yes_button";
static int width = gameX2 - gameX1;
static int height = gameY2 - gameY1;
static Map<String, Clickable> clks = new HashMap<>();
static {
clks.put(HISTORY_B, new Clickable(610, 474));
clks.put(REWARD_B, new Clickable(1086, 135));
clks.put(CLAIM_B, new Clickable(1160, 207));
clks.put(DIAMOND_B, new Clickable(1280, 210));
clks.put(CONTINUE_B, new Clickable(get(DIAMOND_B), -300, 170));
clks.put(BATTLE_B, new Clickable(get(DIAMOND_B), 40, 240));
clks.put(BATTLE2_B, new Clickable(928, 484));
clks.put(WITHDRAW_B, new Clickable(get(BATTLE2_B).getX(), 50));
clks.put(NO_B, new Clickable(get(CONTINUE_B), 0, 30));
clks.put(CENTER_A, new Clickable(800, 200));
clks.put(ROSHA_B, new Clickable(660, 460));
clks.put(CAMP_B, new Clickable(740, 455));
clks.put(RETREAT_B, new Clickable(940, 60));
clks.put(RETREAT_CONFIRM_B, new Clickable(860, 415));
clks.put(CONTINUE_AFTER_GAME_B, new Clickable(860, 415));
clks.put(NEXT_BATTLE_B, new Clickable(935, 379));
clks.put(EXIT_GAME_B, new Clickable(825, 15));
clks.put(ANDROID_APP_B, new Clickable(935, 475));
clks.put(SS_ICON, new Clickable(725, 212));
clks.put(BATTLE_ANYWAY_B, new Clickable(843, 411));
clks.put(REALLY_QUIT_NO_B, new Clickable(1030, 415));
clks.put(REALLY_QUIT_YES_B, new Clickable(840, 415));
}
public static Clickable get(String name) {
return clks.get(name);
}
static Clickable getRandomPoint() {
int x = (int) Math.floor(Math.random() * (inner_gameX2 - inner_gameX1) + inner_gameX1);
int y = (int) Math.floor(Math.random() * (inner_gameY2 - inner_gameY1) + inner_gameY1);
return new Clickable(x, y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment