Changeset 230 for binary-improvements/AllocsCommands/Commands/ListItems.cs
- Timestamp:
- Apr 18, 2015, 4:27:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/ListItems.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class ListItems : ConsoleC ommand6 public class ListItems : ConsoleCmdAbstract 7 7 { 8 public ListItems (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "lists all items that contain the given substring"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "listitems", "li" }; 20 16 } 21 17 22 public override void Run (string[] _params)18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 23 19 { 24 20 try { 25 if (_params. Length!= 1 || _params [0].Length == 0) {26 m_Console.SendResult ("Usage: listitems <searchString>");21 if (_params.Count != 1 || _params [0].Length == 0) { 22 SdtdConsole.Instance.Output ("Usage: listitems <searchString>"); 27 23 return; 28 24 } … … 31 27 foreach (string s in ItemList.Instance.ItemNames) { 32 28 if (s.ToLower ().Contains (_params [0].ToLower ())) { 33 m_Console.SendResult (" " + s);29 SdtdConsole.Instance.Output (" " + s); 34 30 n++; 35 31 } 36 32 } 37 33 38 m_Console.SendResult ("Listed " + n + " matching items.");34 SdtdConsole.Instance.Output ("Listed " + n + " matching items."); 39 35 } catch (Exception e) { 40 36 Log.Out ("Error in ListItems.Run: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.