Gorn 4 Posted March 3, 2020 GroundItem[] loot = manager.getGroundItems().getGroundItems(lootTile); Can you rename this to something like 'getGroundItemsOnTile'? I was just banging my head on why getGroundItems doesn't take Tile type, but you can't rename it cause it would break old code right? It's pretty confusing for newcomers
Zawy 989 Posted March 3, 2020 Looks pretty clear to me https://gyazo.com/94164106cff7b6dbe75633d7402096f3
Gorn 4 Author Posted March 3, 2020 That's what I was looking at and didn't realize you have to write it twice like getGroundItems().getGroundItems(lootTile) Basically there are 2 different functions both named getGroundItems and I didn't realize it right away. Especially confusing when you need to chain them like this.
Nuclear Nezz 2062 Posted May 10, 2020 On 3/3/2020 at 9:24 AM, Gorn said: That's what I was looking at and didn't realize you have to write it twice like getGroundItems().getGroundItems(lootTile) Basically there are 2 different functions both named getGroundItems and I didn't realize it right away. Especially confusing when you need to chain them like this. That's because we have the api class "GroundItems" and then you have the method to retrieve ground items. After looking at it though I do notice that the other api classes don't follow the same trend, since they use filters and such. I'm updating it to have the method getItemsOnTile(Tile t) and deprecating the getGroundItems(Tile t) Thank you for the report/suggestion!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.