This class represent the Game that contains the main game loop and glues all components together
Inheritance: Microsoft.Xna.Framework.Game, IEvent
 public WaterUnit(MyGame game,Vector3 Position, Vector3 Rotation, Vector3 Scale)
     : base(game,Position, Rotation, Scale)
 {
     reflectionTarg = new RenderTarget2D(game.GraphicsDevice, game.GraphicsDevice.Viewport.Width,
        game.GraphicsDevice.Viewport.Height, false, SurfaceFormat.Color,
        DepthFormat.Depth24);
 }
 public WaterUnit(MyGame game, Vector3 Position, Vector3 Rotation, Vector3 Scale)
     : base(game, Position, Rotation, Scale)
 {
     reflectionTarg = new RenderTarget2D(game.GraphicsDevice, game.GraphicsDevice.Viewport.Width,
                                         game.GraphicsDevice.Viewport.Height, false, SurfaceFormat.Color,
                                         DepthFormat.Depth24);
 }
Exemple #3
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (MyGame game = new MyGame())
     {
         game.Run();
     }
 }
 public PlayerUnit(MyGame game,Vector3 Position, Vector3 Rotation, Vector3 Scale)
     : base(game,Position, Rotation, Scale)
 {
     game.mediator.register(this, MyEvent.C_FORWARD, MyEvent.C_BACKWARD, MyEvent.C_LEFT,
         MyEvent.C_RIGHT, MyEvent.C_Pointer, MyEvent.M_BITE);
     health = 100;
 }
 public Weapon(MyGame game,Player player, Model model, Unit unit)
     : base(game, unit, new CModel(game, model))
 {
     this.player = player;
     Matrix[] transforms = new Matrix[model.Bones.Count];
     model.CopyAbsoluteBoneTransformsTo(transforms);
 }
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (MyGame game = new MyGame())
     {
         game.Run();
     }
 }
Exemple #7
0
 /// <summary>
 /// Constructor that initiliaze the projection matrix
 /// </summary>
 /// <param name="game">The instance of MyGame the game component is attached to</param>
 public Camera(MyGame game)
     : base(game)
 {
     this.Projection = Matrix.CreatePerspectiveFieldOfView(
         MathHelper.PiOver4, Game.GraphicsDevice.Viewport.AspectRatio, 0.1f, 1000000.0f);
     myGame = game;
 }
 /// <summary>
 /// Constructor that initiliaze the projection matrix
 /// </summary>
 /// <param name="game">The instance of MyGame the game component is attached to</param>
 public Camera(MyGame game)
     : base(game)
 {
     this.Projection = Matrix.CreatePerspectiveFieldOfView(
         MathHelper.PiOver4, Game.GraphicsDevice.Viewport.AspectRatio, 0.1f, 1000000.0f);
     myGame = game;
 }
Exemple #9
0
 public Weapon(MyGame game, Player player, Model model, Unit unit)
     : base(game, unit, new CModel(game, model))
 {
     this.player = player;
     Matrix[] transforms = new Matrix[model.Bones.Count];
     model.CopyAbsoluteBoneTransformsTo(transforms);
 }
Exemple #10
0
 public PlayerUnit(MyGame game, Vector3 Position, Vector3 Rotation, Vector3 Scale)
     : base(game, Position, Rotation, Scale)
 {
     game.mediator.register(this, MyEvent.C_FORWARD, MyEvent.C_BACKWARD, MyEvent.C_LEFT,
                            MyEvent.C_RIGHT, MyEvent.C_Pointer, MyEvent.M_BITE);
     health = 100;
 }
        /// <summary>
        /// List of all UI span elements used to select recognized text.
        /// </summary>
        //private List<Span> recognitionSpans;

        public SpeechRecognizer(MyGame game) : base(game)
        {
            myGame = game;
            // Look through all sensors and start the first connected one.
            // This requires that a Kinect is connected at the time of app startup.
            // To make your app robust against plug/unplug,
            // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit
            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                if (potentialSensor.Status == KinectStatus.Connected)
                {
                    this.sensor = potentialSensor;
                    break;
                }
            }

            if (null != this.sensor)
            {
                try
                {
                    // Start the sensor!
                    this.sensor.Start();
                }
                catch (IOException)
                {
                    // Some other application is streaming from the same Kinect sensor
                    this.sensor = null;
                }
            }

            if (null == this.sensor)
            {
                return;
            }

            RecognizerInfo ri = GetKinectRecognizer();

            if (null != ri)
            {
                this.speechEngine = new SpeechRecognitionEngine(ri.Id);
            }
            else
            {
                this.speechEngine = new SpeechRecognitionEngine();
            }

            //// Create a grammar from grammar definition XML file.
            using (var memoryStream = new MemoryStream(File.ReadAllBytes("SpeechGrammar.xml")))
            {
                var g = new Grammar(memoryStream);
                speechEngine.LoadGrammar(g);
            }

            speechEngine.SpeechRecognized += SpeechRecognized;

            speechEngine.SetInputToAudioStream(
                sensor.AudioSource.Start(), new SpeechAudioFormatInfo(AudioFormat, AudioSamplesPerSecond, AudioBitsPerSample, AudioChannels, AudioAverageBytesPerSecond, AudioBlockAlign, null));
            speechEngine.RecognizeAsync(RecognizeMode.Multiple);
        }
 /// <summary>
 /// Constructor that initialize the bullet manager
 /// </summary>
 /// <param name="game">Instance of MyGame this game component is attached to</param>
 public BulletsManager(MyGame game)
     : base(game)
 {
     bullets = new List <Bullet>();
     myGame  = game;
     events  = new List <Event>();
     game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END);
 }
        public SkyCubeModel(MyGame game, Model model, TextureCube Texture)
            : base(game,model)
        {
            effect = game.Content.Load<Effect>("skysphere_effect");
            effect.Parameters["CubeMap"].SetValue(Texture);

            SetModelEffect(effect, false);
        }
Exemple #14
0
        public CModel(MyGame game, Model Model)
        {
            reinitialize(Model);

            myGame = game;

            events = new List <Event>();
        }
Exemple #15
0
 public PlayerModel(MyGame game, SkinnedModel skinnedModel)
     : base(game, skinnedModel)
 {
     game.mediator.register(this, MyEvent.P_RUN, MyEvent.C_ATTACK_BULLET_BEGIN);
     animationController.Speed = 1.2f;
     activeAnimation           = PlayerAnimations.Idle;
     playAnimation();
 }
 public PlayerModel(MyGame game, SkinnedModel skinnedModel)
     : base(game, skinnedModel)
 {
     game.mediator.register(this, MyEvent.P_RUN, MyEvent.C_ATTACK_BULLET_BEGIN);
     animationController.Speed = 1.2f;
     activeAnimation = PlayerAnimations.Idle;
     playAnimation();
 }
Exemple #17
0
        public SkyCubeModel(MyGame game, Model model, TextureCube Texture)
            : base(game, model)
        {
            effect = game.Content.Load <Effect>("skysphere_effect");
            effect.Parameters["CubeMap"].SetValue(Texture);

            SetModelEffect(effect, false);
        }
        public MonsterUnit(MyGame game,Vector3 Position, Vector3 Rotation, Vector3 Scale, MonsterConstants monsterConstants)
            : base(game,Position, Rotation, Scale)
        {
            direction = Vector3.Transform(Vector3.Backward,
                Matrix.CreateFromYawPitchRoll(rotation.Y,rotation.X,rotation.Z));

            this.monsterConstants = monsterConstants;
        }
        public MonsterUnit(MyGame game, Vector3 Position, Vector3 Rotation, Vector3 Scale, MonsterConstants monsterConstants)
            : base(game, Position, Rotation, Scale)
        {
            direction = Vector3.Transform(Vector3.Backward,
                                          Matrix.CreateFromYawPitchRoll(rotation.Y, rotation.X, rotation.Z));

            this.monsterConstants = monsterConstants;
        }
 /// <summary>
 /// Constructor that initialize the bullet manager
 /// </summary>
 /// <param name="game">Instance of MyGame this game component is attached to</param>
 public BulletsManager(MyGame game)
     : base(game)
 {
     bullets = new List<Bullet>();
     myGame = game;
     events = new List<Event>();
     game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END);
 }
        public FirstAidManager(MyGame game)
            : base(game)
        {
            firstAidKits = new List <FirstAid>();
            myGame       = game;

            rnd = new Random();
        }
        public CModel(MyGame game, Model Model)
        {
            reinitialize(Model);

            myGame = game;

            events = new List<Event>();
        }
        public FirstAidManager(MyGame game)
            : base(game)
        {
            firstAidKits = new List<FirstAid>();
            myGame = game;

            rnd = new Random();
        }
 public CDrawableComponent(MyGame game,Unit unit, CModel model)
     : base(game)
 {
     myGame = game;
     this.unit = unit;
     this.cModel = model;
     unit.BoundingSphere = cModel.buildBoundingSphere();
     unit.BoundingBox = cModel.buildBoundingBox();
 }
Exemple #25
0
        // Pause variables
        //int pauseDelay = 300;
        //int pauseCountdown = 0;

        public StateManager(MyGame game)
            : base(game)
        {
            myGame = game;

            spriteBatch   = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction();
            myGame.mediator.register(this, MyEvent.G_PAUSE, MyEvent.G_RESUME);
        }
Exemple #26
0
 public CDrawableComponent(MyGame game, Unit unit, CModel model)
     : base(game)
 {
     myGame              = game;
     this.unit           = unit;
     this.cModel         = model;
     unit.BoundingSphere = cModel.buildBoundingSphere();
     unit.BoundingBox    = cModel.buildBoundingBox();
 }
        // Pause variables
        //int pauseDelay = 300;
        //int pauseCountdown = 0;
        public StateManager(MyGame game)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction();
            myGame.mediator.register(this, MyEvent.G_PAUSE,MyEvent.G_RESUME);
        }
        /// <summary>
        /// List of all UI span elements used to select recognized text.
        /// </summary>
        //private List<Span> recognitionSpans;
        public SpeechRecognizer(MyGame game)
            : base(game)
        {
            myGame = game;
            // Look through all sensors and start the first connected one.
            // This requires that a Kinect is connected at the time of app startup.
            // To make your app robust against plug/unplug,
            // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit
            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                if (potentialSensor.Status == KinectStatus.Connected)
                {
                    this.sensor = potentialSensor;
                    break;
                }
            }

            if (null != this.sensor)
            {
                try
                {
                    // Start the sensor!
                    this.sensor.Start();
                }
                catch (IOException)
                {
                    // Some other application is streaming from the same Kinect sensor
                    this.sensor = null;
                }
            }

            if (null == this.sensor)
            {
                return;
            }

            RecognizerInfo ri = GetKinectRecognizer();

            if (null != ri)
                this.speechEngine = new SpeechRecognitionEngine(ri.Id);
            else
                this.speechEngine = new SpeechRecognitionEngine();

                //// Create a grammar from grammar definition XML file.
                using (var memoryStream = new MemoryStream(File.ReadAllBytes("SpeechGrammar.xml")))
                {
                    var g = new Grammar(memoryStream);
                    speechEngine.LoadGrammar(g);
                }

                speechEngine.SpeechRecognized += SpeechRecognized;

                speechEngine.SetInputToAudioStream(
                    sensor.AudioSource.Start(), new SpeechAudioFormatInfo(AudioFormat, AudioSamplesPerSecond, AudioBitsPerSample, AudioChannels, AudioAverageBytesPerSecond, AudioBlockAlign, null));
                speechEngine.RecognizeAsync(RecognizeMode.Multiple);
        }
Exemple #29
0
        public ScoreBoard(MyGame game)
            : base(game)
        {
            this.camera = game.camera;
            myGame      = game;
            game.mediator.register(this, MyEvent.M_DIE);
            events = new List <Event>();

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
        }
        public ScoreBoard(MyGame game)
            : base(game)
        {
            this.camera = game.camera;
            myGame = game;
            game.mediator.register(this, MyEvent.M_DIE);
            events = new List<Event>();

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
        }
Exemple #31
0
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);

            MyGame demo = new MyGame();

            if (demo.Construct(256, 240, 2, 2) == PixelGameEngine.rcode.OK)
            {
                demo.Start();
            }
        }
        public FreeCamera(MyGame game, Vector3 Position, float Yaw, float Pitch,
            float minHeight, float maxHeight)
            : base(game)
        {
            this.Position = Position;
            this.Yaw = Yaw;
            this.Pitch = Pitch;
            this.minHeight = minHeight;
            this.maxHeight = maxHeight;

            translation = Vector3.Zero;
        }
Exemple #33
0
        public FreeCamera(MyGame game, Vector3 Position, float Yaw, float Pitch,
                          float minHeight, float maxHeight)
            : base(game)
        {
            this.Position  = Position;
            this.Yaw       = Yaw;
            this.Pitch     = Pitch;
            this.minHeight = minHeight;
            this.maxHeight = maxHeight;

            translation = Vector3.Zero;
        }
Exemple #34
0
        public Unit(MyGame game, Vector3 position, Vector3 rotation, Vector3 scale)
        {
            baseWorld = Matrix.Identity;

            this.position = position;
            this.rotation = rotation;
            this.scale    = scale;

            this.myGame = game;

            this.events = new List <Event>();
        }
Exemple #35
0
        public Unit(MyGame game,Vector3 position,Vector3 rotation,Vector3 scale)
        {
            baseWorld = Matrix.Identity;

            this.position = position;
            this.rotation = rotation;
            this.scale = scale;

            this.myGame = game;

            this.events = new List<Event>();
        }
 /// <summary>
 /// Constructor that initialize the chase camera properties and set the mouse to the middle of the screen
 /// </summary>
 /// <param name="game">instance of MyGame this game component is attched to</param>
 /// <param name="PositionOffset">offset of the position from the chasee</param>
 /// <param name="TargetOffset">offset of the target from the chasee</param>
 /// <param name="RelativeCameraRotation">reletaive camera rotation with respect to the chasee</param>
 public ChaseCamera(MyGame game, Vector3 PositionOffset, Vector3 TargetOffset,
     Vector3 RelativeCameraRotation )
     : base(game)
 {
     this.savedTargetOffset = TargetOffset;
     this.savedPositionOffset = PositionOffset;
     initialPositionOffset = PositionOffset;
     this.PositionOffset = PositionOffset;
     this.TargetOffset = TargetOffset;
     this.RelativeCameraRotation = RelativeCameraRotation;
     Mouse.SetPosition(myGame.GraphicsDevice.Viewport.Width / 2, myGame.GraphicsDevice.Viewport.Height / 2);
     lastMouseState = Mouse.GetState();
 }
 /// <summary>
 /// Constructor that initialize the chase camera properties and set the mouse to the middle of the screen
 /// </summary>
 /// <param name="game">instance of MyGame this game component is attched to</param>
 /// <param name="PositionOffset">offset of the position from the chasee</param>
 /// <param name="TargetOffset">offset of the target from the chasee</param>
 /// <param name="RelativeCameraRotation">reletaive camera rotation with respect to the chasee</param>
 public ChaseCamera(MyGame game, Vector3 PositionOffset, Vector3 TargetOffset,
                    Vector3 RelativeCameraRotation)
     : base(game)
 {
     this.savedTargetOffset      = TargetOffset;
     this.savedPositionOffset    = PositionOffset;
     initialPositionOffset       = PositionOffset;
     this.PositionOffset         = PositionOffset;
     this.TargetOffset           = TargetOffset;
     this.RelativeCameraRotation = RelativeCameraRotation;
     Mouse.SetPosition(myGame.GraphicsDevice.Viewport.Width / 2, myGame.GraphicsDevice.Viewport.Height / 2);
     lastMouseState = Mouse.GetState();
 }
        public Player(MyGame game, SkinnedModel skinnedModel, Unit unit)
            : base(game, unit, new PlayerModel(game, skinnedModel))
        {
            foreach (ModelMesh mesh in skinnedModel.Model.Meshes)
                foreach (SkinnedEffect effect in mesh.Effects)
                    effect.EnableDefaultLighting();

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            crossHairTex = game.Content.Load<Texture2D>("crosshair");
            delayedAction = new DelayedAction(500);
            //run at first to show to the character otherwise the character dont show
            playerRun();
        }
        public Screen(MyGame game,int delayedActionDelay)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction(delayedActionDelay);

            background = game.Content.Load<Texture2D>("poster");

            smallFont = Game.Content.Load<SpriteFont>("SpriteFont1");
            mediumFont = Game.Content.Load<SpriteFont>("SpriteFontMedium");
            bigFont = Game.Content.Load<SpriteFont>("SpriteFontLarge");
        }
Exemple #40
0
        public Screen(MyGame game, int delayedActionDelay)
            : base(game)
        {
            myGame = game;

            spriteBatch   = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction(delayedActionDelay);


            background = game.Content.Load <Texture2D>("poster");

            smallFont  = Game.Content.Load <SpriteFont>("SpriteFont1");
            mediumFont = Game.Content.Load <SpriteFont>("SpriteFontMedium");
            bigFont    = Game.Content.Load <SpriteFont>("SpriteFontLarge");
        }
Exemple #41
0
        public Player(MyGame game, SkinnedModel skinnedModel, Unit unit)
            : base(game, unit, new PlayerModel(game, skinnedModel))
        {
            foreach (ModelMesh mesh in skinnedModel.Model.Meshes)
            {
                foreach (SkinnedEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();
                }
            }

            spriteBatch   = new SpriteBatch(game.GraphicsDevice);
            crossHairTex  = game.Content.Load <Texture2D>("crosshair");
            delayedAction = new DelayedAction(500);
            //run at first to show to the character otherwise the character dont show
            playerRun();
        }
        public AudioManager(MyGame game)
            : base(game)
        {
            myGame = game;
            events = new List<Event>();
            game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END, MyEvent.M_BITE,
                MyEvent.G_NextLevel, MyEvent.G_GameOver,MyEvent.M_HIT);

            audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
            waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");

            trackCue =  soundBank.GetCue("Cowboy");
            levelCompleteCue = soundBank.GetCue("LevelComplete");
            trackCue.Play();
            trackCue.Pause();
        }
Exemple #43
0
        public Water(MyGame game, Model model, Unit unit)
            : base(game, unit, new CModel(game, model))
        {
            waterEffect = game.Content.Load <Effect>("WaterEffect");
            cModel.SetModelEffect(waterEffect, false);

            waterEffect.Parameters["viewportWidth"].SetValue(
                game.GraphicsDevice.Viewport.Width);

            waterEffect.Parameters["viewportHeight"].SetValue(
                game.GraphicsDevice.Viewport.Height);

            waterEffect.Parameters["WaterNormalMap"].SetValue(
                game.Content.Load <Texture2D>("water_normal"));

            ((WaterUnit)unit).waterEffect = waterEffect;
        }
        public Water(MyGame game, Model model, Unit unit)
            : base(game,unit,new CModel(game, model))
        {
            waterEffect = game.Content.Load<Effect>("WaterEffect");
            cModel.SetModelEffect(waterEffect, false);

            waterEffect.Parameters["viewportWidth"].SetValue(
                game.GraphicsDevice.Viewport.Width);

            waterEffect.Parameters["viewportHeight"].SetValue(
                game.GraphicsDevice.Viewport.Height);

            waterEffect.Parameters["WaterNormalMap"].SetValue(
                game.Content.Load<Texture2D>("water_normal"));

            ((WaterUnit)unit).waterEffect = waterEffect;
        }
        public MonstersManager(MyGame game)
            : base(game)
        {
            monsters = new List<Monster>();
            deadMonsters = new List<Monster>();
            myGame = game;

            rnd[0] = new Random();
            rnd[1] = new Random();

            hpBillBoardSystem = new HPBillboardSystem(game.GraphicsDevice, game.Content, Constants.HP_SIZE, monsters);
            //skinnedModel = Game.Content.Load<SkinnedModel>(@"Textures\EnemyBeast");

            reinitializeMonstersTypes();

            myGame.mediator.register(this, MyEvent.G_NextLevel_END_OF_MUSIC);
        }
Exemple #46
0
        public AudioManager(MyGame game)
            : base(game)
        {
            myGame = game;
            events = new List <Event>();
            game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END, MyEvent.M_BITE,
                                   MyEvent.G_NextLevel, MyEvent.G_GameOver, MyEvent.M_HIT);


            audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
            waveBank    = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank   = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");

            trackCue         = soundBank.GetCue("Cowboy");
            levelCompleteCue = soundBank.GetCue("LevelComplete");
            trackCue.Play();
            trackCue.Pause();
        }
        public MonstersManager(MyGame game)
            : base(game)
        {
            monsters     = new List <Monster>();
            deadMonsters = new List <Monster>();
            myGame       = game;

            rnd[0] = new Random();
            rnd[1] = new Random();


            hpBillBoardSystem = new HPBillboardSystem(game.GraphicsDevice, game.Content, Constants.HP_SIZE, monsters);
            //skinnedModel = Game.Content.Load<SkinnedModel>(@"Textures\EnemyBeast");

            reinitializeMonstersTypes();

            myGame.mediator.register(this, MyEvent.G_NextLevel_END_OF_MUSIC);
        }
 public TargetCamera(MyGame game, Vector3 Position, Vector3 Target)
     : base(game)
 {
     this.Position = Position;
     this.Target   = Target;
 }
Exemple #49
0
 public Monster(MyGame game, CModel model, Unit unit)
     : base(game, unit, model)
 {
     monsterModel = ((MonsterModel)cModel);
     monsterUnit  = ((MonsterUnit)unit);
 }
 public StartScreen(MyGame game)
     : base(game,100)
 {
     emptyTex = game.Content.Load<Texture2D>("empty2");
 }
 public AnimatedModel(MyGame game,SkinnedModel skinnedModel)
     : base(game,skinnedModel.Model)
 {
     reinitialize2(skinnedModel);
 }
 public SkyCubeUnit(MyGame game, Vector3 Position, Vector3 Rotation, Vector3 Scale)
     : base(game,Position, Rotation, Scale)
 {
 }
 public FrameRateCounter(Game game)
     : base(game)
 {
     myGame = (MyGame)game;
 }
 public StartScreen(MyGame game)
     : base(game, 100)
 {
     emptyTex = game.Content.Load <Texture2D>("empty2");
 }
 public BulletUnit(MyGame game,Vector3 Position, Vector3 Rotation, Vector3 Scale,Vector3 Direction)
     : base(game,Position, Rotation, Scale)
 {
     this.Direction = Direction;
 }
 public HelpScreen(MyGame game)
     : base(game, 300)
 {
 }
 public CreditsScreen(MyGame game)
     : base(game,500)
 {
 }
 public HelpScreen(MyGame game)
     : base(game,300)
 {
 }
Exemple #59
0
 public Tree(MyGame game, Model model, Unit unit, Texture2D Texture)
     : base(game,unit,new CModel(game, model))
 {
 }
Exemple #60
0
 public Bullet(MyGame game, Model model, Unit unit)
     : base(game, unit, new CModel(game, model))
 {
 }