{"id":18271906,"url":"https://github.com/jeremyflores/cocosMNC","last_synced_at":"2025-04-05T02:30:52.815Z","repository":{"id":137208798,"uuid":"472618","full_name":"jeremyflores/cocosMNC","owner":"jeremyflores","description":"Provides a model-view-controller (MVC) design pattern for cocos2D for iPhone. Since cocos2D uses nodes instead of views, this implementation is known as a model-node-controller (MNC).","archived":false,"fork":false,"pushed_at":"2011-06-06T23:16:58.000Z","size":7289,"stargazers_count":63,"open_issues_count":0,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-05T11:54:22.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jeremyflor.es","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyflores.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-14T21:40:19.000Z","updated_at":"2023-12-22T14:46:32.000Z","dependencies_parsed_at":"2023-03-13T20:49:07.975Z","dependency_job_id":null,"html_url":"https://github.com/jeremyflores/cocosMNC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyflores%2FcocosMNC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyflores%2FcocosMNC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyflores%2FcocosMNC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyflores%2FcocosMNC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyflores","download_url":"https://codeload.github.com/jeremyflores/cocosMNC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247279299,"owners_count":20912857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:39:35.362Z","updated_at":"2025-04-05T02:30:47.769Z","avatar_url":"https://github.com/jeremyflores.png","language":"Objective-C","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"Provides a model-view-controller (MVC) design pattern for cocos2d for iPhone. Since cocos2d uses nodes instead of views, this implementation is known as a model-node-controller (MNC).\n\ncocosMNC is designed such that there is one view per controller, one controller per view, and one model per controller. However, there may be more than one view-controller pair per model.\n\nThis repository has an XCode project included which demonstrates a simple implementation of cocosMNC: the base cocosMNC code is in the \"Shared\" directory, meant to be shared between various XCode projects.\n\nThis version of cocosMNC was only tested with version 0.99.4 of cocos2d.\n\n==================================================\n\nHOW TO USE cocosMNC:\n\nFirst, make sure to include the AbstractModel, CCNode+Additions, and CCNodeController files to your project (and import them as needed since they are not imported into cocos2d.h).\n\nFor the CCNode files, navigate to the libs/cocos2d folder in your project's directory. In there, you must replace the original CCNode.h and CCNode.m files with the cocosMNC versions of those files, which are found in the cocosMNC/Shared directory. (These altered CCNode files should not change the behavior of normal CCNode files--they merely send messages to the CCNode's controller.)\n\nThen, to define custom behavior on receiving touches, subclass CCNodeController and override the normal touch delegate methods (like ccTouchBegan:withEvent:). CCNodeController will automatically register/unregister itself for touch notifications whenever the CCNode is entered or exited.\n\nFinally, subclass AbstractModel to define custom information for the MVC pattern. This subclass is responsible for calling [self didChange] whenever the CCNode should be updated (this could be accomplished, for example, by using properties for variables and manually defining their setter method).\n\n==================================================\n\nThis code is published under the MIT License:\n\n\nCopyright (c) 2010 Jeremy Flores\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyflores%2FcocosMNC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyflores%2FcocosMNC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyflores%2FcocosMNC/lists"}