Table of Contents

Class SampSharpEnvironment

Namespace
SampSharp.Entities
Assembly
SampSharp.OpenMp.Entities.dll

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

original SampSharpEnvironment

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

EntryAssembly Assembly

The assembly which was configured to launch in open.mp. Used to discover game mode classes and other application types.

Core ICore

The ICore interface for the open.mp server. Provides access to core server functionality and extensions.

Components IComponentList

The IComponentList of open.mp. Manages all game components (players, vehicles, objects, etc.) accessible on the server.

SafeComponentHandleProvider ISafeComponentHandleProvider

A 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

IComponentList

Core

The ICore interface for the open.mp server. Provides access to core server functionality and extensions.

public ICore Core { get; init; }

Property Value

ICore

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

Assembly

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

SafeComponentHandleProvider

A provider of safe handles of open.mp components.

public ISafeComponentHandleProvider SafeComponentHandleProvider { get; init; }

Property Value

ISafeComponentHandleProvider

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

EntryAssembly Assembly
Core ICore
Components IComponentList
SafeComponentHandleProvider ISafeComponentHandleProvider

Equals(SampSharpEnvironment?)

public virtual bool Equals(SampSharpEnvironment? other)

Parameters

other SampSharpEnvironment

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(SampSharpEnvironment?, SampSharpEnvironment?)

public static bool operator ==(SampSharpEnvironment? left, SampSharpEnvironment? right)

Parameters

left SampSharpEnvironment
right SampSharpEnvironment

Returns

bool

operator !=(SampSharpEnvironment?, SampSharpEnvironment?)

public static bool operator !=(SampSharpEnvironment? left, SampSharpEnvironment? right)

Parameters

left SampSharpEnvironment
right SampSharpEnvironment

Returns

bool