Dave Tolls wrote:You can't.
Stuff hosted outside of here is quite often not visible to those of us behind corporate firewalls.
It's why we suggest copy pasting.
Dave Tolls wrote:I can't see any of that lot here, I'm afraid.
Dave Tolls wrote:I don't expect you're able to see the request that goes out to get that page?
Are you able to duplicate the issue in the browser directly (preferably with the dev tools open so you can check the network traffic)?
Dave Tolls wrote:What browser are you pretending to be?
Because that page seems to have a browser check.
Paul Clapham wrote:
Jake Martins wrote:I did not mean any insult or injury, Im sorry if my cold response did that.
No, no, it's fine, I didn't notice anything adverse.
If by anychance you could advise me to a solution or a show me the way, I would really appreciate that! I'm having the worst headache because of this code, but its part of the learning process :/
thanks a bunch for your analysis!
So you're starting with a CSV file. It looks to me like each line in the file is a model? And an Entity is supposed to contain a single model? If that's the case then your ModelReader class needs to produce a list of Entity objects, one for each model.
And if that's the case then ModelReader doesn't need lists of x, y, and z (it shouldn't have them anyway but that's another story) and it doesn't need that map for model files. Here's my rough sketch of what it should do for each line in the CSV file:
1. Read and interpret the data from one line of the CSV (that's lines 98 to 107).
2. Build an Entity from that data (that's lines 121 to 124, modified to use the data directly).
3. Add that to the ModelReader's list of Entity objects.
On the other hand if I have misunderstood the architecture of models and entities, then that isn't the way to do it.
Paul Clapham wrote:
Jake Martins wrote:from lines 98 to 111 : here Im getting whats in the csv file then adding "what I need from them" to arrays OR hashmaps, then using these array & hashmap(s) in the a loop with the model code
No; from lines 98 to 111 you get one line of the CSV file and add one entry to a HashMap.
And then from lines 115 to 129 you iterate through the HashMap entries you have so far (not necessarily all of them which you will eventually create) -- and not only that, you do that iteration once for the first row and eight times for the second row. And not only that, but the end result of each of those iterations is an Entity object -- however you only store the last of those nine Entity objects in the variable named Entity. All of the earlier ones are overwritten.
As it happens, this is exactly the same result you'd get by only using the last line of the CSV file.
Carey Brown wrote:I would suggest that you temporarily put the CSV stuff aside and hard code data for a single entity and see if you can get that to display.
Paul Clapham wrote:It looks to me like lines 98 to 111 are supposed to process one model, which I assume is one line of the models.csv file.
Then I think you ought to do those lines for all lines in models.csv before carrying on to line 115 and so on, because it looks to me like they are supposed to be applied to all your models. Right now it looks to me like you're doing them for each model. (Correct indentation of your code would help a lot, but there's no } after line 111 so I'm pretty sure of what I'm saying.)
I'm also dubious about your static members; in object-oriented code they are often a way to make something happen with only the last thing processed. But I haven't looked closely enough to know for sure.
Carey Brown wrote:Before getting to far along, perhaps you could tell us how these models are supposed to behave in your game. So, we'd need some requirements or use cases in order to keep you steered down the right track.
Jake Martins wrote:Uhm no I dont use the modelnumber to look up.. haven't got to that yet.
I'm gonna try what you wrote and get back to you asap!
Carey Brown wrote:This is a guess because I don't know how you intend on accessing it (e.g. HashMap?).
It looks like you need a "Model" class (or something more appropriately named). For each line of the CSV you create a new Model, fill in the fields, and add it to your Map.
I suggest that you do not use float/double for the key into a map, any floating point round off errors may prevent you from finding what you're looking for. Can you look things up by modelNumber?