/*jslint plusplus: true, white: true, indent: 2, maxlen: 90 */
/**
* @author Wolfgang Kowarschick
* @copyright 2013, Wolfgang Kowarschick
* <br/>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted under the terms of the
* Creative Commons License Attribution-NonCommercial-ShareAlike 3.0 Unported
* (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/).
*/
// Define package $app$.game.snake, if that has not already be done.
(function($app$)
{ "use strict";
////////////////////////////////////////////////////////////////////////////////
// Class "AppSnake"
////////////////////////////////////////////////////////////////////////////////
// import
var Plane = $app$.game.snake.Plane,
Snake = $app$.game.snake.Snake,
Controller = $app$.game.snake.Controller,
Menu = $app$.game.snake.Menu,
Score = $app$.game.snake.Score;
/**
* @class
* @name $app$.game.snake.AppSnake
*
* @param {Object} p_init
* Should contain the attributes
* <code>canvasID</code> (the id of the canvas tag),
* <code>colsNr</code> (the number of columns of the plane),
* <code>rowsNr</code> (the number of rows of the plane),
* <code>item</code> (the initialization object for the items
* that are placed on the plane).
*/
function AppSnake(p_init)
{ var l_plane = new Plane (p_init.plane),
l_snake = new Snake (p_init.snake, l_plane),
l_controller = new Controller(p_init.controller, l_plane, l_snake);
new Menu (p_init.menu, l_controller);
new Score (p_init.score, l_controller, l_snake);
}
$app$.game.snake.AppSnake = AppSnake;
////////////////////////////////////////////////////////////////////////////////
// End of Class "AppSnake"
////////////////////////////////////////////////////////////////////////////////
}(this.$app$));