/*
 * Copyright (c) 2009, syuu
 * Licensed under the NicoCache License.
 */

package com.dokukino.genkidama;

/**
 * application version definition class.
 * @author syuu
 * @version $Rev: 127 $
 */
public final class VersionInfo {
	public final static String APPLICATION_NAME = "Genkidama";
	public final static short APPLICATION_ID = 0x0999;
	public final static short APPLICATION_MAJOR_VERSION = 3;
	public final static int APPLICATION_MINOR_VERSION = 3;
	
	/**
	 * return application name and version(major + minor).
	 * @since Rev 55
	 * @return "Genkidama x.x.y"
	 */
	public final static String getFullVersion(){
		String name = APPLICATION_NAME;
		StringBuilder sb = new StringBuilder(name);
		sb.append(" ");
		sb.append(getShortVersion());
		return sb.toString();
	}
	
	/**
	 * use from Ant task
	 * @param args
	 * @since Rev 94
	 * @author token
	 */
	public static void main(String[] args){
		System.out.println(getShortVersion());
	}
	
	/**
	 * get short version info ( x.x.y )
	 * @return "x.x.y"
	 * @since Rev 94
	 * @author token
	 */
	public static String getShortVersion(){
		double major = Short.valueOf(APPLICATION_MAJOR_VERSION).doubleValue()/10;
		int minor = APPLICATION_MINOR_VERSION;
		
		StringBuilder sb = new StringBuilder(Double.toString(major));
		sb.append(".");
		sb.append(minor);
		return sb.toString();
	}
}
