コード例 #1
0
        /// <summary>
        /// The Constructor of ElliotModel
        /// </summary>
        /// <param name="_sharedVariables"></param>
        /// <param name="edge"></param>
        internal ElliotModel(SharedVariables _sharedVariables, int edge)
        {
            // Sets the sharedvariables to the passed in shared variables.
            this._sharedVariables = _sharedVariables;

            // Sets the edge to the passed in edge.
            _edge = edge;
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="vars">The shared variables</param>
        /// <param name="screenWidth">The width of the screen</param>
        /// <param name="wrapper">The wrapper</param>
        internal DanielModel(SharedVariables vars, int screenWidth, ModelWrapper wrapper, int timeDelay)
        {
            //Set the variables
            _vars = vars;

            _vars.SetTimeDelay(timeDelay);

            //Set the screen width
            _screenWidth = screenWidth;

            //Set the wrapper
            _wrapper = wrapper;
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="rows">Row</param>
        /// <param name="cols">Column</param>
        /// <param name="width">Width of tiles</param>
        /// <param name="height">Height of tiles</param>
        /// <param name="screenWidth">Width of screen</param>
        /// <param name="topOffset">Offset of top of board</param>
        /// <param name="edge">The left edge of the board</param>
        public ModelWrapper(int rows, int cols, int width, int height, int screenWidth, int topOffset, int edge, int timeDelay)
        {
            //Create the variables
            _vars = new SharedVariables(rows, cols, width, height);

            //Create the models
            _dModel = new DanielModel(_vars, screenWidth, this, timeDelay);
            _eModel = new ElliotModel(_vars, edge);

            //Initialize the plants
            _plants = new Plant[SharedVariables.PLANT_COUNT];

            //Set the screen width
            _screenWidth = screenWidth;

            //Set the top offset
            _topOffset = topOffset;

            //Set the plants
            SetPlants();
        }