Skip to content

Instantly share code, notes, and snippets.

View WanionCane's full-sized avatar

Wanderson WanionCane

  • São Paulo, Brasil
View GitHub Profile
@WanionCane
WanionCane / UniDict Resource Gathering API Usage Example.java
Last active December 11, 2021 01:22
UniDict Resource Gathering API Usage Example
// first we get the Instance of UniDictAPI.
UniDictAPI uniDictAPI = UniDict.getAPI();
// getting the actual kind id isn't required, but it is a good practice, the methods accepts strings without any issues.
int ore = Resource.getKindFromName("ore");
int dust = Resource.getKindFromName("dust");
// we are getting the resources that contains ore, and dust.
// the getResources method acts as a filter, so we don't need to null-check the resources later.
// note: there is no limit here, so we could add way more than just ore, and dust.