Пример #1
0
 public static CombatVehicle CombatVehicleFactory(GameObjectCollection collection, PlayerGameObject controllingPlayer, Vector2 position)
 {
     CombatVehicle vehicle = new CombatVehicle(collection);
     collection.Add(vehicle);
     CombatVehicle.ServerInitialize(vehicle, controllingPlayer, position);
     return vehicle;
 }
Пример #2
0
 public static Transport TransportFactory(GameObjectCollection collection, PlayerGameObject controllingPlayer, Vector2 position)
 {
     Transport vehicle = new Transport(collection);
     collection.Add(vehicle);
     Transport.ServerInitialize(vehicle, controllingPlayer, position);
     return vehicle;
 }
 public PlayerGameObject(GameObjectCollection collection)
     : base(collection)
 {
     playerID = new IntegerGameObjectMember(this, 0);
     colorIndex = new IntegerGameObjectMember(this, 0);
     companies = new GameObjectReferenceListField<Company>(this);
 }
Пример #4
0
 public Vehicle(GameObjectCollection collection)
     : base(collection)
 {
     controllingPlayer = new GameObjectReferenceField<PlayerGameObject>(this);
     company = new GameObjectReferenceField<Company>(this);
     materiel = new FloatGameObjectMember(this, 10);
     maxMateriel = new FloatGameObjectMember(this, 10);            
 }
Пример #5
0
 public Base(GameObjectCollection collection)
     : base(collection)
 {
     materiel = new FloatGameObjectMember(this, 0);
     controllingPlayer = new GameObjectReferenceField<PlayerGameObject>(this);
     buildQueue = new IntegerQueueGameObjectField(this);
     resupplyQueue = new GameObjectReferenceQueueField<Vehicle>(this);
 }
Пример #6
0
 public Company(GameObjectCollection collection)
     : base(collection)
 {          
     controllingPlayer = new GameObjectReferenceField<PlayerGameObject>(this);
     combatVehicles = new GameObjectReferenceListField<CombatVehicle>(this);
     transportVehicles = new GameObjectReferenceListField<Transport>(this);
     supplyPoint = new GameObjectReferenceField<Base>(this);
 }
Пример #7
0
 public static GameObject Construct(Type type, GameObjectCollection collection, int id)
 {
     object[] constuctorParams = new object[1];
     constuctorParams[0] = collection;
     GameObject obj = (GameObject)GameObjectTypes.constructorDictionary[type].Invoke(constuctorParams);
     obj.id = id;
     collection.Add(obj);
     return obj;
 }
        //TODO: if we don't actuall put the inital values we want in here, should the v argument be removed?
        public TreeVector2Member(PhysicalObject obj, Vector2 v)
            : base(obj)
        {
            simulationValue = v;
            drawValue = v;
            previousValue = v;

            this.obj = obj;
            this.collection = obj.Collection;
        }
Пример #9
0
 public void SetPositions(GameObjectCollection collection, List<Vector2> positions)
 {
     for (int i = 0; i < positions.Count && i < combatVehicles.Value.Count; i++)
     {
         try
         {
             combatVehicles.Value[i].Dereference().TargetPosition = positions[i];
         }
         catch (Exception)
         {
         }
     }
 }
Пример #10
0
 public GameObject(GameObjectCollection collection)
 {
     this.collection = collection;
     this.id = this.collection.NextID;
 }
Пример #11
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.camera = new Camera(new Vector2(0), 1f, 0, this.graphics, inputManager);

            SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice);
            myGraphicsObject = new MyGraphicsClass(this.graphics, spriteBatch, this.camera);

            gameObjectCollection = new GameObjectCollection(worldSize);
        }
Пример #12
0
 public CombatVehicle(GameObjectCollection collection)
     : base(collection)
 {
     targetPosition = new Vector2GameObjectMember(this, new Vector2(0));
 }
Пример #13
0
 public Transport(GameObjectCollection collection)
     : base(collection)
 {
     vicToResupply = new GameObjectReferenceField<CombatVehicle>(this);
 }
Пример #14
0
 public PhysicalObject(GameObjectCollection collection)
     : base(collection)
 {
     position = new TreeVector2Member(this, new Vector2(0));
     direction = new InterpolatedAngleGameObjectMember(this, 0);
 }
Пример #15
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.camera = new Camera(new Vector2(0), 1f, 0, this.graphics);

            SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice);
            myGraphicsObject = new DrawingUtils.MyGraphicsClass(this.graphics, spriteBatch, this.camera);

            backGround = new BackGround(worldSize);
            gameObjectCollection = new GameObjectCollection(worldSize);
        }