public void Remove(string objectName) { ClothingBase clothingObject = (ClothingBase)this.clothing[objectName]; this.clothing.Remove(objectName); clothingObject.Remove(this); }
public ClothingBase GetTopMostGarment(ClothingPosition clothingPos) { for (var layer = 10; layer != 0; layer--) { foreach (KeyValuePair <string, ClothingBase> kvp in clothing) { ClothingBase garment = kvp.Value; foreach (ClothingPosition clothPos in garment.clothingPosition) { if (clothPos == clothingPos && garment.layer == layer) { return(garment); } } } } return(null); }
public string GetCurrentVisibleClothingString() { Console.WriteLine("Getting clothing"); StringBuilder toReturn = new StringBuilder(); foreach (KeyValuePair <string, ClothingBase> kvp in clothing) { Clothing.ClothingBase currentGarment = (ClothingBase)kvp.Value; foreach (ClothingPosition clothingPos in currentGarment.clothingPosition) { ClothingBase garment = GetTopMostGarment(clothingPos); if (!toReturn.ToString().Contains(garment.ObjectName)) { toReturn.Append(garment.Description + " (" + garment.ObjectName + ")\n"); } } } return(toReturn.ToString()); }