code:
package com.lilithsthrone.game.inventory.clothing;

/**
 * @since 0.2.4
 * @version 0.2.12
 * @author Innoxia, BlazingMagpie@gmail.com (or ping BlazingMagpie in Discord)
 */
public enum DisplacementDescriptionType {

	DISPLACEMENT_SELF,
	REPLACEMENT_SELF,

	DISPLACEMENT,
	DISPLACEMENT_ROUGH,

	REPLACEMENT,
	REPLACEMENT_ROUGH,

	NPC_ON_NPC_DISPLACEMENT,
	NPC_ON_NPC_DISPLACEMENT_ROUGH,

	NPC_ON_NPC_REPLACEMENT,
	NPC_ON_NPC_REPLACEMENT_ROUGH;

	/**
	 * @param tagsIdentifier "[parent element's tag name] [child element's tag name]", for example "displacementText playerSelf"
	 * @return
	 * @throws IllegalArgumentException
	 */
	public static DisplacementDescriptionType byTagsPath(String tagsIdentifier) throws IllegalArgumentException {
		switch(tagsIdentifier){
			case "displacementText playerNPC":
			case "displacementText NPCPlayer":
			case "displacementText other":
				return DISPLACEMENT;
			case "displacementText playerNPCRough":
			case "displacementText NPCPlayerRough":
			case "displacementText otherRough":
				return DISPLACEMENT_ROUGH;
			case "displacementText playerSelf":
			case "displacementText NPCSelf":
			case "displacementText self":
				return DISPLACEMENT_SELF;
			case "displacementText NPCOtherNPC":
				return NPC_ON_NPC_DISPLACEMENT;
			case "displacementText NPCOtherNPCRough":
				return NPC_ON_NPC_DISPLACEMENT_ROUGH;

			case "replacementText playerNPC":
			case "replacementText NPCPlayer":
			case "replacementText other":
				return REPLACEMENT;
			case "replacementText playerNPCRough":
			case "replacementText NPCPlayerRough":
			case "replacementText otherRough":
				return REPLACEMENT_ROUGH;
			case "replacementText playerSelf":
			case "replacementText NPCSelf":
			case "replacementText self":
				return REPLACEMENT_SELF;
			case "replacementText NPCOtherNPC":
				return NPC_ON_NPC_REPLACEMENT;
			case "replacementText NPCOtherNPCRough":
				return NPC_ON_NPC_REPLACEMENT_ROUGH;

			default:
				throw new IllegalArgumentException();
		}
	}

//	public static DisplacementDescriptionType byTagsPath(String tagsIdentifier) throws IllegalArgumentException {
//		for(DisplacementDescriptionType desc : DisplacementDescriptionType.values()){
//			if(desc.identifier.equals(tagsIdentifier)) return desc;
//		}
//		throw new IllegalArgumentException();
//	}
}

repo_name: klorpa/Pedo

license: unknown


code:
package com.lilithsthrone.game.inventory.clothing;

/**
 * @since 0.1.0
 * @version 0.1.96
 * @author Innoxia
 */
public enum DisplacementType {

	REMOVE_OR_EQUIP("unequip", "", "", "", ""),

	OPEN("open", "opens", "opened", "close", "closes"),

	PULLS_UP("pull up", "pulls up", "pulled up", "pull down", "pulls down"),

	PULLS_DOWN("pull down", "pulls down", "pulled down", "pull up", "pulls up"),

	PULLS_OUT("pull out", "pulls out", "pulled out", "push in", "pushes in"),

	PULLS_OFF("pull off", "pulls off", "pulled off", "pull back on", "pulls back on"),

	SHIFTS_ASIDE("shift aside", "shifts aside", "shifted aside", "replace", "replaces"),

	UNZIPS("unzip", "unzips", "unzipped", "zip up", "zips up"),

	UNTIE("untie", "unties", "untied", "tie-up", "ties-up"),

	UNBUCKLE("unbuckle", "unbuckles", "unbuckled", "buckle up", "buckles up"),

	UNBUTTONS("unbutton", "unbuttons", "unbuttoned", "button up", "buttons up");

	private String description, descriptionThirdPerson, descriptionPast, oppositeDescription, oppositeDescriptionThirdPerson;

	private DisplacementType(String description, String descriptionThirdPerson, String descriptionPast, String oppositeDescription, String oppositeDescriptionThirdPerson) {
		this.description = description;
		this.descriptionThirdPerson = descriptionThirdPerson;
		this.descriptionPast = descriptionPast;
		this.oppositeDescription = oppositeDescription;
		this.oppositeDescriptionThirdPerson = oppositeDescriptionThirdPerson;
	}

	public String getDescription() {
		return description;
	}

	public String getDescriptionThirdPerson() {
		return descriptionThirdPerson;
	}

	public String getDescriptionPast() {
		return descriptionPast;
	}

	public String getOppositeDescription() {
		return oppositeDescription;
	}

	public String getOppositeDescriptionThirdPerson() {
		return oppositeDescriptionThirdPerson;
	}
}


code:
package com.lilithsthrone.game.inventory.clothing;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import com.lilithsthrone.game.character.CharacterUtils;
import com.lilithsthrone.utils.XMLSaving;

/**
 * @since 0.3.3.10
 * @version 0.3.3.10
 * @author Innoxia
 */
public class Outfit implements XMLSaving {

	private String name;
	private OutfitType outfitType;
	private Map<String, String> weapons;
	private Map<String, String> clothing;

	public Outfit(String name, OutfitType outfitType, Map<String, String> weapons, Map<String, String> clothing) {
		this.name = name;
		this.outfitType = outfitType;

		if(weapons==null) {
			this.weapons = new HashMap<>();
		}
		this.weapons = weapons;

		if(clothing==null) {
			this.clothing = new HashMap<>();
		}
		this.clothing = clothing;

	}

	public String getName() {
		return name;
	}

	public OutfitType getOutfitType() {
		return outfitType;
	}

	/**
	 * @return A map of unique weapon IDs, each mapped to a value of the WeaponType id.
	 */
	public Map<String, String> getWeapons() {
		return weapons;
	}

	/**
	 * @return A map of unique clothing IDs, each mapped to a value of the ClothingType id.
	 */
	public Map<String, String> getClothing() {
		return clothing;
	}

	public Element saveAsXML(Element parentElement, Document doc) {
		Element element = doc.createElement("outfit");
		parentElement.appendChild(element);

		CharacterUtils.addAttribute(doc, element, "name", name);
		CharacterUtils.addAttribute(doc, element, "outfitType", outfitType.toString());

		if(!this.getWeapons().isEmpty()) {
			Element innerElement = doc.createElement("weapons");
			element.appendChild(innerElement);
			for(Entry<String, String> e : this.getWeapons().entrySet()) {
				Element weaponElement = doc.createElement("w");
				innerElement.appendChild(weaponElement);
				CharacterUtils.addAttribute(doc, weaponElement, "id", e.getKey());
				CharacterUtils.addAttribute(doc, weaponElement, "typeId", e.getValue());
			}
		}

		if(!this.getClothing().isEmpty()) {
			Element innerElement = doc.createElement("clothing");
			element.appendChild(innerElement);
			for(Entry<String, String> e : this.getWeapons().entrySet()) {
				Element clothingElement = doc.createElement("c");
				innerElement.appendChild(clothingElement);
				CharacterUtils.addAttribute(doc, clothingElement, "id", e.getKey());
				CharacterUtils.addAttribute(doc, clothingElement, "typeId", e.getValue());
			}
		}

		return element;
	}

	public static Outfit loadFromXML(Element parentElement, Document doc) {

		String newName = "";
		OutfitType newOutfitType = null;
		Map<String, String> newWeapons = new HashMap<>();
		Map<String, String> newClothing = new HashMap<>();

		try {
			newName = parentElement.getAttribute("name");
		} catch(Exception ex) {
			System.err.println("Warning: An instance of AbstractClothing was unable to be imported. ("+parentElement.getAttribute("name")+")");
			return null;
		}
		try {
			newOutfitType = OutfitType.valueOf(parentElement.getAttribute("outfitType"));
		} catch(Exception ex) {
			System.err.println("Warning: An instance of AbstractClothing was unable to be imported. ("+parentElement.getAttribute("name")+")");
			return null;
		}

		try {
			Element element = (Element)parentElement.getElementsByTagName("weapons").item(0);
			if(element!=null) {
				NodeList effectElements = element.getElementsByTagName("w");
				for(int i=0; i<effectElements.getLength(); i++){
					Element e = ((Element)effectElements.item(i));
					newWeapons.put(e.getAttribute("id"), e.getAttribute("typeId"));
				}
			}
		} catch(Exception ex) {
		}

		try {
			Element element = (Element)parentElement.getElementsByTagName("clothing").item(0);
			if(element!=null) {
				NodeList effectElements = element.getElementsByTagName("c");
				for(int i=0; i<effectElements.getLength(); i++){
					Element e = ((Element)effectElements.item(i));
					newClothing.put(e.getAttribute("id"), e.getAttribute("typeId"));
				}
			}
		} catch(Exception ex) {
		}

		return new Outfit(newName, newOutfitType, newWeapons, newClothing);
	}

}


code:
package com.lilithsthrone.game.inventory.clothing;

import java.util.ArrayList;
import java.util.List;

import com.lilithsthrone.utils.Colour;

/**
 * @since 0.3.1
 * @version 0.3.1
 * @author Innoxia
 */
public class OutfitPotential {

	private List<AbstractClothingType> types;

	private List<Colour> primaryColours;

	private List<Colour> secondaryColours;

	private List<Colour> tertiaryColours;

	public OutfitPotential(List<AbstractClothingType> types, List<Colour> primaryColours, List<Colour> secondaryColours, List<Colour> tertiaryColours) {
		if(types!=null) {
			this.types = types;
		} else {
			types = new ArrayList<>();
		}
		if(primaryColours!=null) {
			this.primaryColours = primaryColours;
		} else {
			primaryColours = new ArrayList<>();
		}
		if(secondaryColours!=null) {
			this.secondaryColours = secondaryColours;
		} else {
			secondaryColours = new ArrayList<>();
		}
		if(tertiaryColours!=null) {
			this.tertiaryColours = tertiaryColours;
		} else {
			tertiaryColours = new ArrayList<>();
		}
	}

	public List<AbstractClothingType> getTypes() {
		return types;
	}

	public List<Colour> getPrimaryColours() {
		return primaryColours;
	}

	public List<Colour> getSecondaryColours() {
		return secondaryColours;
	}

	public List<Colour> getTertiaryColours() {
		return tertiaryColours;
	}
}


code:
package com.lilithsthrone.game.inventory.clothing;

/**
 * @since 0.3.3.10
 * @version 0.3.3.10
 * @author Innoxia
 */
public enum OutfitSource {

	INVENTORY,

	CELL,

	NOWHERE;
}


code:
package com.lilithsthrone.game.inventory.clothing;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.lilithsthrone.controller.xmlParsing.XMLLoadException;
import com.lilithsthrone.utils.Util;

/**
 * @since 0.3.1
 * @version 0.3.5
 * @author Innoxia
 */
public enum OutfitType {

	/** To be used for characters that attack the player. Might be used for other similar criminal activities. */
	MUGGER,

	/** To be used for characters who sell their bodies. Might be used for other similar activities, such as strippers. */
	PROSTITUTE,

	/** To be used for characters in a casual setting. Either at home, going out, or non-uniformed casual work. */
	CASUAL,

	/** To be used for the character's smart clothing at their job. */
	JOB_SMART,

	/** To be used when performing manual labour or other such work. */
	JOB_LABOUR,

	/** To be used when going clubbing. */
	CLUBBING,

	/** To be used on casual dates, such as to a restaurant. */
	CASUAL_DATE,

	/** To be used on formal occasions, such as fancy balls or cocktail parties. */
	FORMAL_DATE,

	/** Sportswear for exercise. */
	ATHLETIC,

	/** Clothing to be worn to bed. */
	NIGHTWEAR,

	/** Sexy clothing to be worn to bed. */
	NIGHTWEAR_SEXY;

	private static List<AbstractOutfit> allOutfits;
	private static List<AbstractOutfit> moddedOutfits;

	private static Map<AbstractOutfit, String> outfitsToIdMap = new HashMap<>();
	private static Map<String, AbstractOutfit> idToOutfitMap = new HashMap<>();

	public static AbstractOutfit getOutfitTypeFromId(String id) {
		id = Util.getClosestStringMatch(id, idToOutfitMap.keySet());
		return idToOutfitMap.get(id);
	}

	public static String getIdFromOutfitType(AbstractOutfit outfitsType) {
		return outfitsToIdMap.get(outfitsType);
	}

	/**
	 * Used to get all AbstractOutfits in a directory.
	 *
	 * @param idStart The starting String of the ids you want.
	 * @return A list of all AbstractOutfits which have their id starting with the provided String.
	 */
	public static List<AbstractOutfit> getOutfitsFromIdStart(String idStart) {
		List<AbstractOutfit> returnList = new ArrayList<>();
		for(Entry<String, AbstractOutfit> entry : idToOutfitMap.entrySet()) {
			if(entry.getKey().startsWith(idStart)) {
				returnList.add(entry.getValue());
//				System.out.println("x: "+entry.getKey());
			}
		}
//		System.out.println(returnList.size());
		return returnList;
	}

	public static List<AbstractOutfit> getAllOutfits() {
		return allOutfits;
	}

	public static List<AbstractOutfit> getModdedOutfits() {
		return moddedOutfits;
	}

	static {

		allOutfits = new ArrayList<>();

		// Load in modded outfits:
		moddedOutfits = new ArrayList<>();
		File dir = new File("res/mods");

		if (dir.exists() && dir.isDirectory()) {
			File[] modDirectoryListing = dir.listFiles();
			if (modDirectoryListing != null) {
				for (File modAuthorDirectory : modDirectoryListing) {
					File modAuthorOutfitDirectory = new File(modAuthorDirectory.getAbsolutePath()+"/outfits");

					File[] outfitsDirectoriesListing = modAuthorOutfitDirectory.listFiles();
					if (outfitsDirectoriesListing != null) {
						for (File outfitsDirectory : outfitsDirectoriesListing) {
							if (outfitsDirectory.isDirectory()){
								File[] innerDirectoryListing = outfitsDirectory.listFiles((path, filename) -> filename.endsWith(".xml"));
								if (innerDirectoryListing != null) {
									for (File innerChild : innerDirectoryListing) {
										try{
											AbstractOutfit ct = new AbstractOutfit(innerChild) {};
											moddedOutfits.add(ct);
											String id = modAuthorDirectory.getName()+"_"+innerChild.getParentFile().getName()+"_"+innerChild.getName().split("\\.")[0];
//											System.out.println(id);
											outfitsToIdMap.put(ct, id);
											idToOutfitMap.put(id, ct);

										} catch(XMLLoadException ex){ // we want to catch any errors here; we shouldn't want to load any mods that are invalid as that may cause severe bugs
											System.err.println(ex);
											System.out.println(ex); // temporary, I think mod loading failure should be displayed to player on screen
										}
									}
								}
							}
						}
					}
				}
			}
		}

		allOutfits.addAll(moddedOutfits);

		// Add in external res outfits:

		dir = new File("res/outfits");

		if (dir.exists() && dir.isDirectory()) {
			File[] modDirectoryListing = dir.listFiles();
			if (modDirectoryListing != null) {
				for (File modAuthorDirectory : modDirectoryListing) {
					File[] outfitsDirectoriesListing = modAuthorDirectory.listFiles();
					if (outfitsDirectoriesListing != null) {
						for (File outfitsDirectory : outfitsDirectoriesListing) {
							if (outfitsDirectory.isDirectory()){
								File[] innerDirectoryListing = outfitsDirectory.listFiles((path, filename) -> filename.endsWith(".xml"));
								if (innerDirectoryListing != null) {
									for (File innerChild : innerDirectoryListing) {
										try{
											AbstractOutfit ct = new AbstractOutfit(innerChild) {};
											allOutfits.add(ct);
											String id = modAuthorDirectory.getName()+"_"+innerChild.getParentFile().getName()+"_"+innerChild.getName().split("\\.")[0];
//											System.out.println(id);
											outfitsToIdMap.put(ct, id);
											idToOutfitMap.put(id, ct);

										} catch(XMLLoadException ex){ // we want to catch any errors here; we shouldn't want to load any mods that are invalid as that may cause severe bugs
											System.err.println(ex);
											System.out.println(ex); // temporary, I think mod loading failure should be displayed to player on screen
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}


code:
package com.lilithsthrone.game.inventory.clothing;

import java.util.ArrayList;
import java.util.List;

import com.lilithsthrone.game.inventory.InventorySlot;
import com.lilithsthrone.utils.Util;

/**
 * @since 0.2.7
 * @version 0.2.7
 * @author Innoxia
 */
public enum PresetConcealmentLists {

	NONE(new ArrayList<>()),

	CONCEALED_PARTIAL_TORSO(Util.newArrayListOfValues(
			InventorySlot.STOMACH,
			InventorySlot.CHEST,
			InventorySlot.NIPPLE,
			InventorySlot.PIERCING_NIPPLE,
			InventorySlot.PIERCING_STOMACH)),

	CONCEALED_PARTIAL_TORSO_STOMACH_VISIBLE(Util.newArrayListOfValues(
			InventorySlot.CHEST,
			InventorySlot.NIPPLE,
			InventorySlot.PIERCING_NIPPLE)),

	CONCEALED_STOMACH(Util.newArrayListOfValues(
			InventorySlot.PIERCING_STOMACH)),

	CONCEALED_BREASTS(Util.newArrayListOfValues(
			InventorySlot.NIPPLE,
			InventorySlot.PIERCING_NIPPLE)),

	CONCEALED_FULL_TORSO(Util.newArrayListOfValues(
			InventorySlot.TORSO_UNDER,
			InventorySlot.STOMACH,
			InventorySlot.CHEST,
			InventorySlot.NIPPLE,
			InventorySlot.PIERCING_NIPPLE,
			InventorySlot.PIERCING_STOMACH)),

	CONCEALED_GENITALS(Util.newArrayListOfValues(
			InventorySlot.VAGINA,
			InventorySlot.ANUS,
			InventorySlot.PENIS,
			InventorySlot.PIERCING_PENIS,
			InventorySlot.PIERCING_VAGINA)),

	CONCEALED_GROIN(Util.newArrayListOfValues(
			InventorySlot.GROIN,
			InventorySlot.VAGINA,
			InventorySlot.ANUS,
			InventorySlot.PENIS,
			InventorySlot.PIERCING_PENIS,
			InventorySlot.PIERCING_VAGINA)),

	CONCEALED_TAUR(Util.newArrayListOfValues(
			InventorySlot.STOMACH,
			InventorySlot.PIERCING_STOMACH,
			InventorySlot.GROIN,
			InventorySlot.VAGINA,
			InventorySlot.ANUS,
			InventorySlot.PENIS,
			InventorySlot.PIERCING_PENIS,
			InventorySlot.PIERCING_VAGINA)),

	CONCEALED_DRESS_FRONT_FULL(Util.newArrayListOfValues(
			InventorySlot.STOMACH,
			InventorySlot.CHEST,
			InventorySlot.NIPPLE,
			InventorySlot.PIERCING_NIPPLE,
			InventorySlot.PIERCING_STOMACH,
			InventorySlot.GROIN,
			InventorySlot.VAGINA,
			InventorySlot.PENIS,
			InventorySlot.PIERCING_PENIS,
			InventorySlot.PIERCING_VAGINA)),

	CONCEALED_UNZIPS_GROIN(Util.newArrayListOfValues(
			InventorySlot.GROIN,
			InventorySlot.PENIS,
			InventorySlot.PIERCING_PENIS)),

	CONCEALED_ANKLES_FROM_TROUSERS(Util.newArrayListOfValues(
			InventorySlot.ANKLE,
			InventorySlot.SOCK));

	private List<InventorySlot> presetInventorySlotList;

	public List<InventorySlot> getPresetInventorySlotList() {
		return presetInventorySlotList;
	}

	private PresetConcealmentLists(List<InventorySlot> presetInventorySlotList) {
		this.presetInventorySlotList = presetInventorySlotList;
	}

}