Class SampSharpEnvironment
Represents the environment of a SampSharp application, providing access to the entry assembly, game server core, and registered components.
public record SampSharpEnvironment : IEquatable<SampSharpEnvironment>
- Inheritance
-
SampSharpEnvironment
- Implements
- Inherited Members
- Extension Methods
Remarks
SampSharpEnvironment is initialized during the startup process and provides central access to critical application resources. It is typically used to retrieve services, query components, and invoke core functionality.
Constructors
SampSharpEnvironment(SampSharpEnvironment)
protected SampSharpEnvironment(SampSharpEnvironment original)
Parameters
originalSampSharpEnvironment
SampSharpEnvironment(Assembly, ICore, IComponentList, ISafeComponentHandleProvider)
Represents the environment of a SampSharp application, providing access to the entry assembly, game server core, and registered components.
public SampSharpEnvironment(Assembly EntryAssembly, ICore Core, IComponentList Components, ISafeComponentHandleProvider SafeComponentHandleProvider)
Parameters
EntryAssemblyAssemblyThe assembly which was configured to launch in open.mp. Used to discover game mode classes and other application types.
CoreICoreThe ICore interface for the open.mp server. Provides access to core server functionality and extensions.
ComponentsIComponentListThe IComponentList of open.mp. Manages all game components (players, vehicles, objects, etc.) accessible on the server.
SafeComponentHandleProviderISafeComponentHandleProviderA provider of safe handles of open.mp components.
Remarks
SampSharpEnvironment is initialized during the startup process and provides central access to critical application resources. It is typically used to retrieve services, query components, and invoke core functionality.
Properties
Components
The IComponentList of open.mp. Manages all game components (players, vehicles, objects, etc.) accessible on the server.
public IComponentList Components { get; init; }
Property Value
Core
The ICore interface for the open.mp server. Provides access to core server functionality and extensions.
public ICore Core { get; init; }
Property Value
EntryAssembly
The assembly which was configured to launch in open.mp. Used to discover game mode classes and other application types.
public Assembly EntryAssembly { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
SafeComponentHandleProvider
A provider of safe handles of open.mp components.
public ISafeComponentHandleProvider SafeComponentHandleProvider { get; init; }
Property Value
Methods
Deconstruct(out Assembly, out ICore, out IComponentList, out ISafeComponentHandleProvider)
public void Deconstruct(out Assembly EntryAssembly, out ICore Core, out IComponentList Components, out ISafeComponentHandleProvider SafeComponentHandleProvider)
Parameters
EntryAssemblyAssemblyCoreICoreComponentsIComponentListSafeComponentHandleProviderISafeComponentHandleProvider
Equals(SampSharpEnvironment?)
public virtual bool Equals(SampSharpEnvironment? other)
Parameters
otherSampSharpEnvironment
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(SampSharpEnvironment?, SampSharpEnvironment?)
public static bool operator ==(SampSharpEnvironment? left, SampSharpEnvironment? right)
Parameters
leftSampSharpEnvironmentrightSampSharpEnvironment
Returns
operator !=(SampSharpEnvironment?, SampSharpEnvironment?)
public static bool operator !=(SampSharpEnvironment? left, SampSharpEnvironment? right)
Parameters
leftSampSharpEnvironmentrightSampSharpEnvironment