/// <summary> /// Display a String for the Enums /// </summary> /// <param name="value"></param> /// <returns></returns> public static string ToMessage(this SpecificCharacterTypeEnum value) { // Default String var Message = "Unknown"; switch (value) { case SpecificCharacterTypeEnum.SmartyPants: Message = "Smarty Pants"; break; case SpecificCharacterTypeEnum.Overachiever: Message = "Overachiever"; break; case SpecificCharacterTypeEnum.InternationalStudent: Message = "International Student"; break; case SpecificCharacterTypeEnum.Prodigy: Message = "Prodigy"; break; case SpecificCharacterTypeEnum.SecondCareer: Message = "Second Career"; break; case SpecificCharacterTypeEnum.Slacker: Message = "Slacker"; break; case SpecificCharacterTypeEnum.Procrastinator: Message = "Procrastinator"; break; case SpecificCharacterTypeEnum.HelicopterParent: Message = "Helicopter Parent"; break; case SpecificCharacterTypeEnum.CoolParent: Message = "Cool Parent"; break; case SpecificCharacterTypeEnum.Unknown: default: break; } return(Message); }
/// <summary> /// Given the inputted Character, updates the Range based on the SpecificCharacterTypeEnum. /// </summary> /// <param name="newData">Character to update</param> public static int ToRange(SpecificCharacterTypeEnum specificCharacterType) { var range = 1; switch (specificCharacterType) { case SpecificCharacterTypeEnum.SmartyPants: range = 3; break; case SpecificCharacterTypeEnum.Overachiever: range = 3; break; case SpecificCharacterTypeEnum.InternationalStudent: range = 2; break; case SpecificCharacterTypeEnum.Prodigy: range = 2; break; case SpecificCharacterTypeEnum.SecondCareer: range = 2; break; case SpecificCharacterTypeEnum.Slacker: range = 2; break; case SpecificCharacterTypeEnum.Procrastinator: range = 2; break; case SpecificCharacterTypeEnum.HelicopterParent: range = 2; break; case SpecificCharacterTypeEnum.CoolParent: range = 1; break; case SpecificCharacterTypeEnum.Unknown: default: range = 1; break; } return(range); }
/// <summary> /// Given the inputted Character, returns the tile image URI based on the SpecificCharacterTypeEnum. /// </summary> /// <param name="newData">Character to update</param> public static string ToTileImageURI(SpecificCharacterTypeEnum specificCharacterType) { var imageURI = Constants.SpecificCharacterTypeDefaultImageURI;; switch (specificCharacterType) { case SpecificCharacterTypeEnum.SmartyPants: imageURI = Constants.SpecificCharacterTypeSmartyPantsTileImageURI; break; case SpecificCharacterTypeEnum.Overachiever: imageURI = Constants.SpecificCharacterTypeOverachieverTileImageURI; break; case SpecificCharacterTypeEnum.InternationalStudent: imageURI = Constants.SpecificCharacterTypeInternationalStudentTileImageURI; break; case SpecificCharacterTypeEnum.Prodigy: imageURI = Constants.SpecificCharacterTypeProdigyTileImageURI; break; case SpecificCharacterTypeEnum.SecondCareer: imageURI = Constants.SpecificCharacterTypeSecondCareerTileImageURI; break; case SpecificCharacterTypeEnum.Slacker: imageURI = Constants.SpecificCharacterTypeSlackerTileImageURI; break; case SpecificCharacterTypeEnum.Procrastinator: imageURI = Constants.SpecificCharacterTypeProcrastinatorTileImageURI; break; case SpecificCharacterTypeEnum.HelicopterParent: imageURI = Constants.SpecificCharacterTypeHelicopterParentTileImageURI; break; case SpecificCharacterTypeEnum.CoolParent: imageURI = Constants.SpecificCharacterTypeCoolParentTileImageURI; break; case SpecificCharacterTypeEnum.Unknown: default: imageURI = Constants.SpecificCharacterTypeDefaultTileImageURI; break; } return(imageURI); }
/// <summary> /// Returns the ability enum associated with the indicated SpecificCharacterType. /// </summary> /// <param name="specificCharacterType">SpecificCharacterType used to extract ability enum</param> /// <returns>Ability Enum associated with specified SpecificCharacterType</returns> public static AbilityEnum ToAbility(SpecificCharacterTypeEnum specificCharacterType) { var abilityEnum = AbilityEnum.Unknown; switch (specificCharacterType) { case SpecificCharacterTypeEnum.SmartyPants: abilityEnum = AbilityEnum.ExtraCredit; break; case SpecificCharacterTypeEnum.Slacker: abilityEnum = AbilityEnum.Extension; break; case SpecificCharacterTypeEnum.SecondCareer: abilityEnum = AbilityEnum.Extension; break; case SpecificCharacterTypeEnum.Prodigy: abilityEnum = AbilityEnum.ExtraCredit; break; case SpecificCharacterTypeEnum.Procrastinator: abilityEnum = AbilityEnum.Extension; break; case SpecificCharacterTypeEnum.Overachiever: abilityEnum = AbilityEnum.FlashGenius; break; case SpecificCharacterTypeEnum.InternationalStudent: abilityEnum = AbilityEnum.FlashGenius; break; case SpecificCharacterTypeEnum.HelicopterParent: abilityEnum = AbilityEnum.Bribes; break; case SpecificCharacterTypeEnum.CoolParent: abilityEnum = AbilityEnum.PayTuition; break; default: abilityEnum = AbilityEnum.Unknown; break; } return(abilityEnum); }
/// <summary> /// Any time picker changes, items reset based on player type /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnPickerSelectedIndexChanged(object sender, EventArgs e) { var picker = (Picker)sender; // clear the previous items on location ClearPreviousItems(); // get specificCharacterTypeEnum SpecificCharacterTypeEnum SpecificCharacterTypeEnum = SpecificCharacterTypeEnumHelper.ConvertMessageStringToEnum((string)picker.SelectedItem); //get the items based on character newItems = ViewModel.Data.ItemsBasedOnCharacterType(SpecificCharacterTypeEnum); //remove items from page var FlexList = ItemBox.Children.ToList(); foreach (var data in FlexList) { ItemBox.Children.Remove(data); } //add items to page AddItemsToDisplay(); }
/// <summary> /// Given SpecificCharacterTypeEnum return the items /// </summary> /// <param name="newData">Character to update</param> public List <ItemModel> ItemsBasedOnCharacterType(SpecificCharacterTypeEnum characterType) { List <ItemModel> item = new List <ItemModel>(); switch (characterType) { case SpecificCharacterTypeEnum.SmartyPants: var pencil = new ItemModel(ItemTypeEnum.PencilEraser); var indexcard = new ItemModel(ItemTypeEnum.IndexCards); item.Add(pencil); item.Add(indexcard); PrimaryHand = pencil.Id; RightFinger = indexcard.Id; break; case SpecificCharacterTypeEnum.Overachiever: var Textbooks = new ItemModel(ItemTypeEnum.Textbooks); item.Add(Textbooks); PrimaryHand = Textbooks.Id; break; case SpecificCharacterTypeEnum.InternationalStudent: var Notebook = new ItemModel(ItemTypeEnum.Notebook); item.Add(Notebook); PrimaryHand = Notebook.Id; break; case SpecificCharacterTypeEnum.Prodigy: var LibraryCard = new ItemModel(ItemTypeEnum.LibraryCard); item.Add(LibraryCard); Necklace = LibraryCard.Id; break; case SpecificCharacterTypeEnum.SecondCareer: var Laptop = new ItemModel(ItemTypeEnum.Laptop); item.Add(Laptop); PrimaryHand = Laptop.Id; break; case SpecificCharacterTypeEnum.Slacker: var Calculator = new ItemModel(ItemTypeEnum.Calculator); var Skateboard = new ItemModel(ItemTypeEnum.Skateboard); item.Add(Calculator); item.Add(Skateboard); LeftFinger = Calculator.Id; Feet = Skateboard.Id; break; case SpecificCharacterTypeEnum.Procrastinator: var FoodCourtCard = new ItemModel(ItemTypeEnum.FoodCourtCard); item.Add(FoodCourtCard); Necklace = FoodCourtCard.Id; break; case SpecificCharacterTypeEnum.HelicopterParent: var Tuition = new ItemModel(ItemTypeEnum.Tuition); item.Add(Tuition); PrimaryHand = Tuition.Id; break; case SpecificCharacterTypeEnum.CoolParent: var PrivateTutor = new ItemModel(ItemTypeEnum.PrivateTutor); item.Add(PrivateTutor); Necklace = PrivateTutor.Id; break; } return(item); }
/// <summary> /// Given a SpecificCharacterTypeEnum, returns the corresponding CharacterTypeEnum. /// </summary> /// <param name="value"></param> /// <returns></returns> public static CharacterTypeEnum GetCharacterTypeEnumFromSpecificCharacterTypeEnum(SpecificCharacterTypeEnum specificCharacterType) { var result = CharacterTypeEnum.Unknown; switch (specificCharacterType) { case SpecificCharacterTypeEnum.CoolParent: case SpecificCharacterTypeEnum.HelicopterParent: result = CharacterTypeEnum.Parent; break; case SpecificCharacterTypeEnum.InternationalStudent: case SpecificCharacterTypeEnum.Overachiever: case SpecificCharacterTypeEnum.Procrastinator: case SpecificCharacterTypeEnum.Prodigy: case SpecificCharacterTypeEnum.SecondCareer: case SpecificCharacterTypeEnum.Slacker: case SpecificCharacterTypeEnum.SmartyPants: result = CharacterTypeEnum.Student; break; } return(result); }