示例#1
0
 public BeerController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     physicalData.IsAffectedByGravity = false;
     physicalData.CollisionInformation.Events.DetectingInitialCollision += HandleCollision;
 }
示例#2
0
文件: Program.cs 项目: jdcook/Veishea
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
示例#3
0
 public RioterController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     anims = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;
     playerData = game.GetPlayerEntity();
     runSpeed = game.rand.Next(15, 28);
 }
示例#4
0
 public CameraComponent(Game1 game)
     : base(game)
 {
     this.UpdateOrder = 2;
     for (int i = 0; i < NUM_LIGHTS; ++i)
     {
         lightPositions[i] = inactiveLightPos;
     }
 }
示例#5
0
        public AnimatedModelComponent(Game1 game, GameEntity entity, Model model, float drawScale, Vector3 drawOffset)
            : base(game, entity)
        {
            this.model = model;
            this.localOffset = drawOffset;
            this.syncedModels = entity.GetSharedData(typeof(Dictionary<string, Model>)) as Dictionary<string, Model>;
            this.animationPlayer = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;

            animationPlayer.StartClip(animationPlayer.skinningDataValue.AnimationClips.Keys.First(), MixType.None);

            modelParams = new SharedGraphicsParams();
            modelParams.size = new Vector3(drawScale);
            entity.AddSharedData(typeof(SharedGraphicsParams), modelParams);
        }
        /// <summary>
        /// constructs a new model component for rendering models without animations
        /// </summary>
        public UnanimatedModelComponent(Game1 game, GameEntity entity, Model model, Vector3 drawScale, Vector3 localOffset, float yaw, float pitch, float roll)
            : base(game, entity)
        {
            this.model = model;
            this.localOffset = localOffset;

            modelParams = new SharedGraphicsParams();
            modelParams.size = drawScale;
            entity.AddSharedData(typeof(SharedGraphicsParams), modelParams);

            this.yaw = yaw;
            this.pitch = pitch;
            this.roll = roll;

            Matrix3X3 bepurot = physicalData.OrientationMatrix;
            rotation = new Matrix(bepurot.M11, bepurot.M12, bepurot.M13, 0, bepurot.M21, bepurot.M22, bepurot.M23, 0, bepurot.M31, bepurot.M32, bepurot.M33, 0, 0, 0, 0, 1);
        }
示例#7
0
 public CarController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 35;
 }
示例#8
0
 public StaticMeshComponent(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.collidable = Entity.GetSharedData(typeof(StaticMesh)) as StaticMesh;
 }
示例#9
0
 public PlayerController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     anims = entity.GetSharedData(typeof(AnimationPlayer)) as AnimationPlayer;
 }
示例#10
0
 public Component(Game1 game, GameEntity entity)
 {
     this.Game = game;
     this.Entity = entity;
     Remove = false;
 }
示例#11
0
 public DrawableComponent3D(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
 }
示例#12
0
 public ModelManager(Game1 game)
     : base(game)
 {
     camera = game.Services.GetService(typeof(CameraComponent)) as CameraComponent;
     this.UpdateOrder = 3;
 }
示例#13
0
 public PhysicsComponent(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     this.collidable = entity.GetSharedData(typeof(Entity)) as Entity;
 }
示例#14
0
 public LightPoleController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 25;
 }
示例#15
0
 public DestructibleProp(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     physicalData = entity.GetSharedData(typeof(Entity)) as Entity;
     physicalData.CollisionInformation.Events.DetectingInitialCollision += HandleCollision;
 }
示例#16
0
 public GeneralComponentManager(Game1 game)
     : base(game)
 {
 }
示例#17
0
 public EntityManager(Game1 game)
     : base(game)
 {
     this.mainGame = game;
     camera = game.Services.GetService(typeof(CameraComponent)) as CameraComponent;
 }
示例#18
0
 public MailboxController(Game1 game, GameEntity entity)
     : base(game, entity)
 {
     stupid = 10;
 }