mrlegowatch / roleplayingcore Goto Github PK
View Code? Open in Web Editor NEWRole playing game core logic in the Swift language.
License: MIT License
Role playing game core logic in the Swift language.
License: MIT License
Migrate JSON reading and writing code to Codable
SimpleDice is a class (reference type) in order to avoid polluting the Dice protocol with a mutable roll() function, that is immutable for most clients. SimpleDice is different because it needs to store intermediate rolls in an Int array, in order to describe them (roll description). For example, "3d4" might produce a roll description of "(3 + 1 + 5)".
I propose changing the roll() function to return a DiceRoll value type, that holds both the result and the roll description, so that the SimpleDice can be a value type.
Pros:
Cons:
The current requirement for DiceParser is to parse dice strings that are typically specified for hit points, with rolls, modifiers, dropping a throw, and compound dice (multiple dice sub-expressions). The building blocks are there, but the current parser implementation can't handle regular expressions beyond a single compound dice string (e.g., 3d6-2d4 works, but 3d6-2d4+1 does not).
Next steps:
UnitCurrency requires being initialized from load() in order to allow customization for domain-specific currency (D&D 'coinage', space/future 'credits', etc.), but this means that baseUnit() can't return an unwrapped default currency if load() hasn't been called yet. The first loaded currency with a 'default' property wins.
Ideas to consider:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.