JSPM

diceroller

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q28453F
    • License MIT

    Diceroller Module

    Package Exports

    • diceroller

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (diceroller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    DiceRoller

    A simple dice roller for tracking dice rolls by table/players/dice

    Database?

    This is as of right now a skeleton app meant to be used in conjunction with any given implementation. It is database agnostic by default but can work with any relational or NoSQL database by passing in the id/document key as methods/classes are called/instantiated.

    Sample Usage

    var DiceRoller = new DiceRoller();
    DiceRoller.setPlayers(DatabaseResults.Players); // Where results is an object that contains a list of player ids, active table, and etc
    DiceRoller.setTables(DatabaseResults.Tables);
    
    var table = DiceRoller.getTable(activeTable);
    var players = table.getPlayers();
    
    // Here we would cross reference the players with entries in our database
    
    var rolls = [];
    
    for(var i in players) {
        var player = players[i];
        player.addDie(eventDieId,20);
    
        rolls[i] = player.roll(eventDieId, 4, eventMessage);
    }
    
    return rolls;