public OutfitViewModel() { manager = new OutfitManager(); AllGear = manager.GetAllGearPieces(); AvailableGearPieces = manager.GetGearPiecesByBodyPart(AllGear); AvailableDyes = manager.GetDyes(); ChangeImageCommand = new DelegateCommand(ChangeImage); }
public AllViewModel() { Manager = new CharacterManager(); CompanionManager = new CompanionManager(); OutfitManager = new OutfitManager(); Characters = Manager.GetCharacters(); if (Characters != null) Character = Characters.FirstOrDefault(); AddFollowerCommand = new DelegateCommand(AddFollower); }
private bool Add() { string decision, body, name, img, faction; Console.WriteLine("\nFaction: \n[1 - Empire] \n[2 - Republic]"); faction = Console.ReadLine(); while (!Validator.Validate(faction, new string[] { "", "0", "1", "2" })) { Console.WriteLine("Nope. Again!"); faction = Console.ReadLine(); } Console.WriteLine("\nBody part: \n [0 - Head] \n [1 - Chest] \n [2 - Wrists] \n [3 - Hands] \n [4 - Waist] \n [5 - Legs] \n [6 - Feet]"); body = Console.ReadLine(); while (!Validator.Validate(body, new string[] { "0", "1", "2", "3", "4", "5", "6" })) { Console.WriteLine("Nope. Again!"); body = Console.ReadLine(); } Console.Write("\nName: "); name = Console.ReadLine(); string defaultImage = Regex.Replace(name, @"[\s']", ""); defaultImage += faction == "1" ? "Emp" : faction == "2" ? "Rep" : ""; Console.Write("\nImage: "); System.Windows.Forms.SendKeys.SendWait(defaultImage); img = Console.ReadLine(); Console.WriteLine( String.Format("\nObject ready for saving: \n Body part: {0} \n Name: {1} \n Image: {2} \n Faction: {3}", (BodyParts)Int32.Parse(body), name, img, String.IsNullOrEmpty(faction) ? Factions.Any : (Factions)Int32.Parse(faction))); Console.WriteLine("\nAre you sure? \n[Y]/[N]"); decision = Console.ReadLine(); if (decision.ToUpper() == "N") return false; var manager = new OutfitManager(); var obj = manager.AddObject(body, name, img, faction); Console.WriteLine(String.Format("\nSuccesfully saved {0}", obj.Name)); Console.WriteLine("Add another?"); decision = Console.ReadLine(); if (decision.ToUpper() != "N") return false; return true; }
public CompanionViewModel() { OutfitManager = new OutfitManager(); }