private void UpdateState(IInternalCommand command) { if (command is ObjectEnterAreaCommand) { this.AddObject((ObjectEnterAreaCommand)command); } else if (command is ObjectLeaveAreaCommand) { this.RemoveObject((ObjectLeaveAreaCommand)command); } }
private void UpdateStatePersistent(IInternalCommand command) { this.InternalPersist(command, this.UpdateState); }
/// <summary>Add a console command.</summary> /// <param name="command">the SMAPI console command to add.</param> /// <param name="monitor">Writes messages to the console.</param> /// <exception cref="ArgumentException">There's already a command with that name.</exception> public CommandManager Add(IInternalCommand command, IMonitor monitor) { return(this.Add(null, command.Name, command.Description, (name, args) => command.HandleCommand(args, monitor))); }