Skip to content

Commit

Permalink
fix: move code from namespace 'Computerdores' to 'Computerdores.Advan…
Browse files Browse the repository at this point in the history
…cedTerminalAPI'
  • Loading branch information
Computerdores committed Apr 12, 2024
1 parent d545879 commit 9c8d88e
Show file tree
Hide file tree
Showing 37 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System.Collections.Generic;
using BepInEx;
using BepInEx.Logging;
using Computerdores.patch;
using Computerdores.Vanillin;
using Computerdores.AdvancedTerminalAPI.patch;
using Computerdores.AdvancedTerminalAPI.Vanillin;
using HarmonyLib;

namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class AdvancedTerminalAPI : BaseUnityPlugin {
private static AdvancedTerminalAPI Instance { get; set; }
public class Plugin : BaseUnityPlugin {
private static Plugin Instance { get; set; }
internal static ManualLogSource Log => Instance.Logger;
private readonly Harmony _harmony = new(PluginInfo.PLUGIN_GUID);

Expand All @@ -19,7 +19,7 @@ public class AdvancedTerminalAPI : BaseUnityPlugin {
private static InputFieldDriver Driver { get; set; }
private static ITerminal CustomTerminal { get; set; }

public AdvancedTerminalAPI() {
public Plugin() {
Instance = this;
ReplaceITerminal(d => new VanillinTerminal(d));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public struct CommandResult {
public string output;
Expand Down
3 changes: 3 additions & 0 deletions AdvancedTerminalAPI/AdvancedTerminalAPI/Consumer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Computerdores.AdvancedTerminalAPI;

public delegate void Consumer<in T>(T value);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public interface IAliasable {
public IEnumerable<ICommand> GetAll(ITerminal term);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public interface ICommand {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public interface IDescribable {
public string GetUsage();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public interface IPredictable {
public string PredictInput(string partialInput);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public interface ITerminal {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JetBrains.Annotations;
using TMPro;

namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public class InputFieldDriver {

Expand Down
3 changes: 3 additions & 0 deletions AdvancedTerminalAPI/AdvancedTerminalAPI/Method.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Computerdores.AdvancedTerminalAPI;

public delegate T Method<out T, in T2>(T2 input);
3 changes: 3 additions & 0 deletions AdvancedTerminalAPI/AdvancedTerminalAPI/SimpleEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Computerdores.AdvancedTerminalAPI;

public delegate void SimpleEvent();
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Computerdores.patch;
using Computerdores.AdvancedTerminalAPI.patch;

namespace Computerdores;
namespace Computerdores.AdvancedTerminalAPI;

public class TerminalWrapper {
private readonly Terminal _terminal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class AccessibleObjectCommand : ICommand {
private readonly string _name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using HarmonyLib;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class BuyCommand : ICommand, IAliasable {
private bool _awaitingConfirmation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using BepInEx;
using UnityEngine;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class BuyItemCommand : ICommand {
private readonly string _itemName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class BuyUnlockableCommand : ICommand{
private readonly string _itemName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class EjectCommand : ICommand, IPredictable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class FlashCommand : ICommand, IPredictable {
public string GetName() => "flash";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using HarmonyLib;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class InfoCommand : ICommand, IAliasable {
public string GetName() => "info";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class InfoThingCommand : ICommand {
private readonly string _name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class OtherCommand : ICommand {
public string GetName()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class PingCommand : ICommand, IPredictable, IDescribable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using HarmonyLib;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class RouteCommand : ICommand {
private RouteMoonCommand _command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class RouteMoonCommand : ICommand, IAliasable {
private readonly string _moonName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class ScanCommand : ICommand, IDescribable {
public string GetName() => "scan";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class SimpleCommand : ICommand {
private string _name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class SpecialNodeCommand : ICommand {
private readonly string _name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BepInEx;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class SwitchCommand : ICommand, IPredictable, IDescribable {
public string GetName() => "switch";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class TransmitCommand : ICommand, IDescribable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using HarmonyLib;

namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class ViewCommand : ICommand, IAliasable, IDescribable {
public string GetName() => "view";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Computerdores.Vanillin.Commands;
namespace Computerdores.AdvancedTerminalAPI.Vanillin.Commands;

public class ViewThingCommand : ICommand {
private readonly string _name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace Computerdores.Vanillin;
namespace Computerdores.AdvancedTerminalAPI.Vanillin;

public static class Util {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
using System.Linq;
using BepInEx;
using BepInEx.Logging;
using Computerdores.Vanillin.Commands;
using Computerdores.AdvancedTerminalAPI.Vanillin.Commands;
using HarmonyLib;

namespace Computerdores.Vanillin;
namespace Computerdores.AdvancedTerminalAPI.Vanillin;

public class VanillinTerminal : ITerminal {
private readonly InputFieldDriver _driver;

private readonly List<ICommand> _commands = new();
private readonly List<ICommand> _builtinCommands = new();

private static ManualLogSource Log => AdvancedTerminalAPI.Log;
private static ManualLogSource Log => Plugin.Log;

private ICommand _currentCommand;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using HarmonyLib;

namespace Computerdores.patch;
namespace Computerdores.AdvancedTerminalAPI.patch;

// Note: This whole thing will silently fail if there are ever more than 2 terminals in the level
[HarmonyPatch(typeof(Terminal))]
Expand Down Expand Up @@ -53,7 +53,7 @@ public static class TerminalPatch {
[HarmonyPrefix]
[HarmonyPatch(nameof(Terminal.Awake))]
private static void AwakePrefix(Terminal __instance) {
AdvancedTerminalAPI.RegisterTerminal(__instance);
Plugin.RegisterTerminal(__instance);
PreAwake?.Invoke(__instance);
}

Expand Down
3 changes: 0 additions & 3 deletions AdvancedTerminalAPI/Consumer.cs

This file was deleted.

3 changes: 0 additions & 3 deletions AdvancedTerminalAPI/Method.cs

This file was deleted.

3 changes: 0 additions & 3 deletions AdvancedTerminalAPI/SimpleEvent.cs

This file was deleted.

0 comments on commit 9c8d88e

Please sign in to comment.