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; }
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); }
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); }
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); }
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); }
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; }
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) { } } }
public GameObject(GameObjectCollection collection) { this.collection = collection; this.id = this.collection.NextID; }
/// <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); }
public CombatVehicle(GameObjectCollection collection) : base(collection) { targetPosition = new Vector2GameObjectMember(this, new Vector2(0)); }
public Transport(GameObjectCollection collection) : base(collection) { vicToResupply = new GameObjectReferenceField<CombatVehicle>(this); }
public PhysicalObject(GameObjectCollection collection) : base(collection) { position = new TreeVector2Member(this, new Vector2(0)); direction = new InterpolatedAngleGameObjectMember(this, 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); }