public override int GetHashCode() { int hash = 1; if (MlagentsVersion.Length != 0) { hash ^= MlagentsVersion.GetHashCode(); } if (MlagentsEnvsVersion.Length != 0) { hash ^= MlagentsEnvsVersion.GetHashCode(); } if (PythonVersion.Length != 0) { hash ^= PythonVersion.GetHashCode(); } if (TorchVersion.Length != 0) { hash ^= TorchVersion.GetHashCode(); } if (TorchDeviceType.Length != 0) { hash ^= TorchDeviceType.GetHashCode(); } if (NumEnvs != 0) { hash ^= NumEnvs.GetHashCode(); } if (NumEnvironmentParameters != 0) { hash ^= NumEnvironmentParameters.GetHashCode(); } if (RunOptions.Length != 0) { hash ^= RunOptions.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// /// </summary> /// <exception cref="InvalidOperationException">Thrown if a TorchBase instance already exists.</exception> protected TorchBase() { if (Instance != null) { throw new InvalidOperationException("A TorchBase instance already exists."); } Instance = this; TorchVersion = Assembly.GetExecutingAssembly().GetName().Version; TorchVersionVerbose = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? TorchVersion.ToString(); RunArgs = new string[0]; Managers = new DependencyManager(); Plugins = new PluginManager(this); Multiplayer = new MultiplayerManager(this); Entities = new EntityManager(this); Network = new NetworkManager(this); Commands = new CommandManager(this); Managers.AddManager(new TorchSessionManager(this)); Managers.AddManager(new FilesystemManager(this)); Managers.AddManager(new UpdateManager(this)); Managers.AddManager(Network); Managers.AddManager(Commands); Managers.AddManager(Plugins); Managers.AddManager(Multiplayer); Managers.AddManager(Entities); Managers.AddManager(new ChatManager(this)); TorchAPI.Instance = this; }