Skip to content

Commit

Permalink
Fix bug with ResourceMap.has comparing wrong resources #313
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Dec 11, 2022
1 parent 752f887 commit ce81063
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ResourceMapImpl(

override fun has(resource: GameResource, value: Int): Boolean = this.getOrDefault(resource) >= value

override fun has(resources: ResourceMap): Boolean = this.resources.all { it.value.value >= resources.getOrDefault(it.key) }
override fun has(resources: ResourceMap): Boolean = resources.entries().all { this.has(it.resource, it.value) }

override fun resources(): Set<GameResource> = this.resources.keys.toSet()
override fun entries(): Set<ResourceEntry> = this.resources.values.toSet()
Expand Down

0 comments on commit ce81063

Please sign in to comment.