Gorn 4 Share 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 Link to comment Share on other sites More sharing options...
Zawy 838 Share Posted March 3, 2020 Looks pretty clear to me https://gyazo.com/94164106cff7b6dbe75633d7402096f3 Link to comment Share on other sites More sharing options...
Gorn 4 Author Share Posted March 3, 2020 (edited) 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. Edited March 3, 2020 by Gorn clarification Link to comment Share on other sites More sharing options...
Nuclear Nezz 1969 Share 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! Gorn 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now