mirror of
https://github.com/DungeonPaper/dungeon_world_data.git
synced 2026-05-18 02:08:58 +00:00
bugfix in tag parsing
This commit is contained in:
@@ -39,6 +39,7 @@ void main() {
|
||||
|
||||
// Parse tags from objects or strings
|
||||
print(Tag.fromJSON({'weight': 1}));
|
||||
print(Tag.fromJSON('{coins: 3}'));
|
||||
print(Tag.fromJSON('close'));
|
||||
|
||||
// All info tags
|
||||
|
||||
@@ -11,7 +11,7 @@ class Tag<T> extends DWEntity {
|
||||
|
||||
String description;
|
||||
|
||||
Tag(this.name, [this.value, this.description]) {
|
||||
Tag(this.name, [this.value, this.description]) : super(key: name) {
|
||||
if (description != null &&
|
||||
description.isNotEmpty &&
|
||||
!tagInfoCache.containsKey(key)) {
|
||||
@@ -43,7 +43,7 @@ class Tag<T> extends DWEntity {
|
||||
var value = int.tryParse(match.group(1));
|
||||
return Tag(name, value as dynamic);
|
||||
}
|
||||
var mapLike = RegExp('\\{(.*):\\s?([0-9]+)\\}');
|
||||
var mapLike = RegExp('\\{(.*):\\s?([+-]?[0-9]+)\\}');
|
||||
|
||||
if (mapLike.hasMatch(obj)) {
|
||||
var match = mapLike.allMatches(obj).toList().first;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: dungeon_world_data
|
||||
homepage: https://github.com/chenasraf/dungeon_world_data
|
||||
description: Data dump of Dungeon World classes, moves, equipment, and more. Also mirrored as NPM package.
|
||||
version: 2.0.2
|
||||
version: 2.0.3
|
||||
|
||||
environment:
|
||||
sdk: ">=2.3.0 <3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user