source: binary-improvements2/MapRendering/src/Commands/EnableRendering.cs@ 402

Last change on this file since 402 was 402, checked in by alloc, 22 months ago
  • Major refactoring
  • Using Utf8Json for (de)serialization
  • Moving APIs to REST
  • Removing dependencies from WebServer and MapRenderer to ServerFixes
File size: 728 bytes
RevLine 
[224]1using System.Collections.Generic;
[391]2using JetBrains.Annotations;
[224]3
[391]4namespace MapRendering.Commands {
5 [UsedImplicitly]
[325]6 public class EnableRendering : ConsoleCmdAbstract {
7 public override string GetDescription () {
[224]8 return "enable/disable live map rendering";
9 }
10
[325]11 public override string[] GetCommands () {
12 return new[] {"enablerendering"};
[224]13 }
14
[325]15 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
[359]16 if (_params.Count != 1) {
[402]17 SdtdConsole.Instance.Output ($"Current state: {MapRenderer.renderingEnabled}");
[359]18 return;
19 }
[224]20
[391]21 MapRenderer.renderingEnabled = _params [0].Equals ("1");
[402]22 SdtdConsole.Instance.Output ($"Set live map rendering to {_params [0].Equals ("1")}");
[224]23 }
24 }
25}
Note: See TracBrowser for help on using the repository browser.