Exemplo n.º 1
0
 public static void CleanJobs()
 {
     foreach (CharacterEntity e in Family.familyMembers)
     {
         VillageAction action = e.Action();
         if (!e.AllowedActions().Contains(action))
         {
             Village.actions[e] = VillageAction.REST;
             continue;
         }
         if (action == VillageAction.QUEST)
         {
             Village.actions[e] = VillageAction.REST;
         }
     }
 }
Exemplo n.º 2
0
    public static (string, string) ActionText(VillageAction action, Date.AgeGroup age)
    {
        switch (action)
        {
        case VillageAction.REST:
            switch (age)
            {
            case Date.AgeGroup.BABY:
                return("Baby", "being a baby is already a full-time job");

            case Date.AgeGroup.CHILD:
                return("Play", "runs outside and explores the world");

            default:
                return("Rest", "recovers some health");
            }

        case VillageAction.QUEST:
            return("Quest", "busy adventuring");

        case VillageAction.FIND_QUEST:
            return("Find Quest", "looks for a quest");

        // case VillageAction.FIND_DUNGEON:
        //     return ("Find Dungeon", "looks for a dungeon containing rare items");
        case VillageAction.WORK:
            return("Work", "gets some money");

        case VillageAction.HUNT:
            return("Hunt", "find some food");

        case VillageAction.ORPHANAGE:
            return("Orphanage", "for adoption");

        case VillageAction.FIND_LOVE:
            return("Look for love", "look for a special someone");

        case VillageAction.LOVE:
            return("Spend time with lover", "to increase the family size");

        default:
            return("ACTION", "ERROR");
        }
    }
Exemplo n.º 3
0
 private void SetAction(VillageAction action)
 {
     Village.actions[entity] = action;
     Refresh();
 }
Exemplo n.º 4
0
 public static IEnumerable <T> Where <T>(this Dictionary <T, VillageAction> actions, VillageAction action)
 {
     return(actions.Where(a => a.Value == action).Select(a => a.Key));
 }
Exemplo n.º 5
0
 public static int Count <T>(this Dictionary <T, VillageAction> actions, VillageAction action)
 {
     return(actions.Values.Where(a => a == action).Count());
 }
Exemplo n.º 6
0
 public static int Count(this IEnumerable <VillageAction> actions, VillageAction action)
 {
     return(actions.Where(a => a == action).Count());
 }