Beispiel #1
0
 public bool TryDoCommand(Players.Player player, string chat, List <string> splits)
 {
     if (player.Equals(null))
     {
         return(false);
     }
     chat.ToLower();
     if (chat.StartsWith("/production"))
     {
         string typeName = ItemTypes.GetType(player.Inventory.Items[0].Type).Name;
         chat = chat.Remove(0, 12);
         if (!ProductionItems.ContainsKey(player.ActiveColony.ColonyID))
         {
             ProductionItems[player.ActiveColony.ColonyID] = new Dictionary <string, int[]>();
         }
         if (chat.StartsWith("add"))
         {
             if (!ProductionItems[player.ActiveColony.ColonyID].ContainsKey(typeName))
             {
                 ProductionItems[player.ActiveColony.ColonyID][typeName] = new int[10];
                 Chat.Send(player, "<color=yellow>Added " + typeName + " to production chain will take 5 ingame days to see all data</color>");
                 return(true);
             }
             Chat.Send(player, "<color=yellow>" + typeName + " is already being recorded</color>");
             return(true);
         }
         else if (chat.StartsWith("remove"))
         {
             if (ProductionItems[player.ActiveColony.ColonyID].ContainsKey(typeName))
             {
                 ProductionItems[player.ActiveColony.ColonyID].Remove(typeName);
                 Chat.Send(player, "<color=yellow>" + typeName + " has been removed</color>");
                 return(true);
             }
             Chat.Send(player, "<color=yellow>" + typeName + " was not being recorded, could not remove</color>");
             return(true);
         }
     }
     return(false);
 }