Noir
  • πŸšΆβ€β™‚οΈIntro
  • πŸ“Tutorials
    • πŸŽ“Starting Noir
    • πŸ“–Libraries
    • πŸ–₯️Services
    • ❔Libraries VS Services
    • πŸ’¬Callbacks
    • πŸ’₯Classes
    • πŸ”ŽDebugging
  • πŸ“šExamples
  • β˜„οΈAPI Reference
    • Bootstrapper
    • Built-Ins
      • Classes
        • AITarget
        • Body
        • Command
        • Connection
        • Event
        • HTTPRequest
        • HTTPResponse
        • Library
        • Message
        • Object
        • Player
        • Service
        • Task
        • TickIterationProcess
        • Tracker
        • Vehicle
        • Widgets
          • MapLabelWidget
          • MapLineWidget
          • MapObjectWidget
          • PopupWidget
          • ScreenPopupWidget
          • Widget
      • Libraries
        • Base64
        • Dataclasses
        • Deprecation
        • Events
        • HTTP
        • JSON
        • Logging
        • Matrix
        • Number
        • String
        • Table
      • Services
        • CommandService
        • GameSettingsService
        • HTTPService
        • MessageService
        • NotificationService
        • ObjectService
        • PlayerService
        • TaskService
        • TPSService
        • UIService
        • VehicleService
    • Callbacks
    • Class
    • Classes
    • Debugging
    • Definition
    • Libraries
    • Noir
    • Services
    • TypeChecking
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Parameters
  • Returns
  • Returns
  • Parameters
Edit on GitHub
  1. API Reference

Services

Noir.Services: table

A module of Noir that allows you to create organized services.

These services can be used to hold methods that are all designed for a specific purpose.


Noir.Services.CreatedServices: table<string, NoirService>

A table containing created services.

You probably do not need to modify or access this table directly. Please use Noir.Services:GetService(name) instead.


Noir.Services:CreateService(name, isBuiltIn, shortDescription, longDescription, authors)

Create a service.

This service will be initialized and started after Noir:Start() is called.

Parameters

  • name: string

  • isBuiltIn: boolean|nil

  • shortDescription: string|nil

  • longDescription: string|nil

  • authors: table<integer, string>|nil

Returns

  • NoirService


Noir.Services:GetService(name)

Retrieve a service by its name.

This will error if the service hasn't initialized yet.

Parameters

  • name: string

Returns

  • NoirService


Noir.Services:RemoveService(name)

Remove a service.

Parameters

  • name: string


Noir.Services:FormatService(service)

Format a service into a string.

Returns the service name as well as the author(s) if any.

Parameters

  • service: NoirService

Returns

  • string


Noir.Services:GetBuiltInServices()

Returns all built-in Noir services.

Returns

  • table<string, NoirService>


Noir.Services:RemoveBuiltInServices(exceptions)

Removes built-in services from Noir. This may give a very slight performance increase.

Use before calling Noir:Start().

Parameters

  • exceptions: table<integer, string> - A table containing exact names of services to not remove

PreviousNoirNextTypeChecking

Last updated 2 months ago

β˜„οΈ