[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Fuck im getting tired of MVC. Let's say I have an array
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 13
Thread images: 1
File: Capture.png (104 KB, 1120x402) Image search: [Google]
Capture.png
104 KB, 1120x402
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 replies: 13
Thread images: 1

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.