[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Fuck im getting tired of MVC. Let's say I have an array

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 13
Thread images: 1

File: Capture.png (104KB, 1120x402px) Image search: [Google]
Capture.png
104KB, 1120x402px
Fuck im getting tired of MVC.
Let's say I have an array of integers representing a game world's data:

x and y values for drawing and item id(8)
0,0,32,32,8 x100


What's the correct way of passing those value from the Model to the Draw function in my View? Should I just create the same array inside my View?
>>
>>54860216
The numbers you posted, are those just a sample of the values you want to pass into your method?
>>
>>54860261
0,0,200,200,0,200,0,200,200,0,400,0,200,200,0,0,200..... are read from a file and stored in an array inside the model.

Now I need that array in my View for the g.drawRect methods and for defining Shapes that will be have mouselisteners attached to them in the controller.

The simplest way to do it would be to just type model.array but it's against everything in MVC
>>
>>54860216
My friend, have you tried googling it?
>>
>>54860375
Yes
>>
Niggers.
>>
More niggers.
>>
Even more niggers.
>>
just make a method to get the a copy of the current world state
>>
Still more niggers.
>>
>>54860216
Send Model data to View, use that data in the View.
>>
So many niggers.
>>
Niggers, niggers everywhere.
Thread posts: 13
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.