Usage

To instantiate the RankSystem class, use the following syntax:

const RankSystem = require('division-rank');

const initialDivisions = [
    { name: 'Gold', options: { minPoints: 1000, maxPoints: 2000 } },
    { name: 'Silver', options: { minPoints: 500, maxPoints: 999 } }
];

const rankSystem = new RankSystem(initialDivisions);

Arguments

  • initialDivisions (Array of Objects, optional): An array where each object represents an initial division configuration. Each division object should have:

    • name (String): The name of the division.

    • options (Object): An object containing:

      • minPoints (Number): The minimum rating points required to be in this division.

      • maxPoints (Number): The maximum rating points allowed to be in this division.

Example

const RankSystem = require('division-rank');

const initialDivisions = [
    { name: 'Gold', options: { minPoints: 1000, maxPoints: 2000 } },
    { name: 'Silver', options: { minPoints: 500, maxPoints: 999 } }
];

const rankSystem = new RankSystem(initialDivisions);

This example demonstrates how to instantiate a new RankSystem object with initial divisions defined by their name and rating range options. Adjust the initialDivisions array to customize the divisions according to your application's requirements.

Last updated