コード例 #1
0
 public override string ParseCommand(ChatMessage msg)
 {
     string[] message = msg.Message.Split(' ');
     if (message.Length > 1)
     {
         string def = ANIMAL_DEFS.TryGetValue(message[1]);
         if (def != null)
         {
             List <Pawn> matching = AnimalSelection.GetAllTameAnimalsInOrderWithDef(def);
             if (matching != null && matching.Count > 0)
             {
                 return(GetPrettyAnimalList(matching));
             }
             else
             {
                 return("No tamed animals " + def + " found");
             }
         }
         else
         {
             return("The animal " + def + " was not found. The animal type is probably misspelled.");
         }
     }
     return(null);
 }
コード例 #2
0
 private string GetPrettyAnimalCount(string animalType)
 {
     return("Total count of " + animalType + " in the colony: " + AnimalSelection.GetAllTameAnimalsInOrderWithDef(animalType).Count);
 }