Constants.java :  » Game » magicwars » mw » client » constants » Java Open Source

Java Open Source » Game » magicwars 
magicwars » mw » client » constants » Constants.java
package mw.client.constants;

import java.awt.Rectangle;
import java.io.File;

/**
 * Client constants.
 * 
 */
public class Constants {

  public static final int IMAGE_CACHE_SIZE = 30;
  
  public static final String RESOURCE_PATH = "/images";
  public static final String RESOURCE_PATH_INFO = resourcePath("info");
  public static final String RESOURCE_PATH_GAME = resourcePath("game");
  public static final String RESOURCE_PATH_BG = resourcePath("bg");
  public static final String RESOURCE_PATH_BUTTONS = resourcePath("buttons");
  public static final String RESOURCE_PATH_BORDS = resourcePath("borders");
  public static final String RESOURCE_PATH_PHASE = resourcePath("phase");
  public static final String RESOURCE_PATH_COMBAT = resourcePath("combat");
  public static final String RESOURCE_PATH_ICONS = resourcePath("icons");
  public static final String RESOURCE_PATH_LABELS = resourcePath("labels");
  public static final String RESOURCE_PATH_ADVANCED = resourcePath("advanced");
  public static final String RESOURCE_PATH_EDITOR = resourcePath("editor");
  public static final String RESOURCE_PATH_ABILITIES = resourcePath("abilities");
  public static final String RESOURCE_PATH_HEROES = resourcePath("heroes");
  public static final String RESOURCE_PATH_MANA = resourcePath("mana");

  public static final String PROPERTIES_FILE = "MagicWars.properties";
  public static final String IMAGE_PROPERTIES_FILE = "images" + File.separator + "image.url.properties";
  public static final String BASE_SOUND_PATH = "res" + File.separator + "sounds" + File.separator;
  public static final String DEFAULT_ADDRESS = "127.0.0.1";
  public static final String DEFAULT_PORT = "2000";
  public static final String DEFAULT_NICKNAME = "Player";
  public static final String DEFAULT_CACHE_DIR = "cache";
  public static final String DEFAULT_LOGS_DIR = "cache" + File.separator + "logs";
  public static final String DEFAULT_DECKS_DIR = "mydecks";
  public static final String DECKS_FILENAME = "all-decks";
  public static final String CARDS_CACHE_FILENAME = "allcards.offline.cache";
  public static final String BG_CACHE_FILENAME = "bg{0}.cache";

  public static final Rectangle CARD_SIZE_SHANDALAR = new Rectangle(130, 130);
  public static final Rectangle CARD_SIZE_FULL = new Rectangle(101, 149);
  
  public static final Rectangle IMAGE_SIZE_CROPPED = new Rectangle(110, 101);
  
  public static final Rectangle DEFAULT_CARD_IMAGE_SIZE = new Rectangle(200, 285);
  public static final Rectangle PREVIEW_CARD_IMAGE_SIZE = new Rectangle(260, 370);
  
  public static final int RANDOM_CARDPOOL_CONSTRUCTED_COUNT = 60;

  /**
   * Build resource path.
   * 
   * @param folder
   * @return
   */
  private static String resourcePath(String folder) {
    return RESOURCE_PATH + "/" + folder;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.