Skip to content

server.services.ToolService.ToolService

Mahatma Kollu edited this page Oct 19, 2021 · 2 revisions

Class: ToolService

server/services/ToolService.ToolService

Manages the state of a player's tools and contains utility functions for interfacing with tools.

Implements

  • OnInit

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ToolService()

Properties

store

store: Store<State, Actions>

Defined in

src/server/services/ToolService.ts:118

Methods

InitModelInterface

Private InitModelInterface(): void

Begins the tool-model interface to allow empty models to create AET tools.

Returns

void

Defined in

src/server/services/ToolService.ts:128


InitStore

Private InitStore(): void

Initalizes the tool store by connecting to various events to ensure the tool store is always up to date.

Returns

void

Defined in

src/server/services/ToolService.ts:163


InitTool

InitTool(tool): void

Tracks a tool so that it's information if properly displayed in the tool store.

Parameters

Name Type Description
tool ITool The tool to be tracked in the tool store

Returns

void

Defined in

src/server/services/ToolService.ts:187


TryAddModelToTool

Private TryAddModelToTool(instance, parent): void

Makes an empty model with a tool's name into a tool if compatible and then tracks when the model is destroyed which destroys the tool.

Parameters

Name Type Description
instance Instance an instance which if a model will be made into a tool
parent Player -

Returns

void

Defined in

src/server/services/ToolService.ts:149


addTool

addTool(toolName, parent): Model

Creates a new tool which has the model of the toolName provided and parents the tool to the parent provided.

Parameters

Name Type Description
toolName "Shield" | "Kopis" | "Sparta" | "Athens" name of a tool model
parent Instance | Player a player or part to parent the tool to

Returns

Model

Defined in

src/server/services/ToolService.ts:219


onInit

onInit(): void

Returns

void

Implementation of

OnInit.onInit

Defined in

src/server/services/ToolService.ts:120

Clone this wiki locally