package net.sourceforge.pain.logic.fn.util;
import net.sourceforge.pain.data.*;
import net.sourceforge.pain.data.type.*;
/**
 * User: fmike * Date: Aug 17, 2003  * Time: 2:55:35 AM
 */
public final class LangUtil {
	public static final String[] name = new String[]{"north", "east", "south", "west", "up", "down"};
	public static final String he(int sex) {
		if (sex == LifeForm.SEX_MALE) {
			return "he";
		} else if (sex == LifeForm.SEX_FEMALE) {
			return "she";
		}
		return "it";
	}
	public static final String He(int sex) {
		if (sex == LifeForm.SEX_MALE) {
			return "He";
		} else if (sex == LifeForm.SEX_FEMALE) {
			return "She";
		}
		return "It";
	}
	private static String him(int sex) {
		if (sex == LifeForm.SEX_MALE) {
			return "him";
		} else if (sex == LifeForm.SEX_FEMALE) {
			return "her";
		}
		return "it";
	}
	private static String his(int sex) {
		if (sex == LifeForm.SEX_MALE) {
			return "his";
		} else if (sex == LifeForm.SEX_FEMALE) {
			return "her";
		}
		return "its";
	}
	public static final String he(LogicalObject obj) {
		LifeForm lf = (LifeForm) obj.getRole(LifeForm.class);
		if (lf == null) {
			return he(LifeForm.SEX_UNDEFINED);
		} else {
			return he(lf.getSex());
		}
	}
	public static final String him(LogicalObject obj) {
		LifeForm lf = (LifeForm) obj.getRole(LifeForm.class);
		if (lf == null) {
			return him(LifeForm.SEX_UNDEFINED);
		} else {
			return him(lf.getSex());
		}
	}
	public static final String his(LogicalObject obj) {
		LifeForm lf = (LifeForm) obj.getRole(LifeForm.class);
		if (lf == null) {
			return his(LifeForm.SEX_UNDEFINED);
		} else {
			return his(lf.getSex());
		}
	}
	public static String directionName(int type) {
		return name[type];
	}
	public static String s(int num, String str) {
		if (num > 1) {
			return str + "s";
		}
		return str;
	}
}