//private Effect effect; public FireEffectDrawer(IObjectEffect objectEffect, GameObject gameObject) : base(objectEffect, gameObject) { this.gameObject = gameObject; this.objectEffect = objectEffect; //this.effect = effect; }
public MaterialReader(GameObject gameObject, string name) { this.gameObject = gameObject; xml=XDocument.Load("Data\\materials\\"+name+".xml"); // Vector3 test = getVector("BlueGlass", "specular"); //Vector4 ble; }
//TODO: ENUM!!!!!!!! (albo XML) /// <summary> /// Deprecated /// </summary> /// <param name="gameObject"></param> /// <param name="name"></param> private void AddEffectToAnObject(GameObject gameObject, string name) { IObjectEffect gameEffect; if (name == "water") gameEffect = new WaterEffect(gameObject,MainGame); else if(name=="fire") { gameEffect = new FireEffect(gameObject, MainGame); AddEffectToAnObject(gameObject,"smoke"); gameEffect.IsActive = true; } else { gameEffect = new FireSmokeEffect(gameObject, MainGame); gameEffect.IsActive = true; } gameObject.EffectList.Add(gameEffect); }
public void PointTurretToGameObject(GameObject gameObject) { var longitudinalDifference = gameObject.Position.X - Position.X; var latitudinalDifference = gameObject.Position.Z - Position.Z; double result = 0; var azimuth = (Math.PI * .5d) - Math.Atan(latitudinalDifference / longitudinalDifference); if (longitudinalDifference > 0) result = azimuth; else if (longitudinalDifference < 0) result = azimuth + Math.PI; else if (latitudinalDifference < 0) result = Math.PI; else result = 0d; turretDestination = (float)(result - Angle.Y); }
private int[,] PutUnits(ref int[,] map, List<GameObject> gameObjects, GameObject current) { int[,] output = new int[map.GetLength(0), map.GetLength(1)]; for (int i = 0; i < map.GetLength(0); i++) { for (int j = 0; j < map.GetLength(1); j++) { output[i, j] = map[i, j]; } } foreach (GameObject gameObject in gameObjects) { if ((gameObject is Unit || gameObject is Civilian) && gameObject != current) { IPhysical physical = gameObject as IPhysical; int startI = Convert.ToInt32(Math.Floor(gameObject.Position.X - physical.Width/2.0)) - lastRadius; if(startI < 0) startI = 0; int endI = Convert.ToInt32(Math.Ceiling(gameObject.Position.X + physical.Width/2.0)) + lastRadius; if(endI >= map.GetLength(0)) endI = map.GetLength(0) - 1; int startJ = Convert.ToInt32(Math.Floor(gameObject.Position.Z - physical.Length/2.0)) - lastRadius; if (startJ < 0) startJ = 0; int endJ = Convert.ToInt32(Math.Ceiling(gameObject.Position.Z + physical.Length/2.0)) + lastRadius; if (endJ >= map.GetLength(0)) endI = map.GetLength(0) - 1; for (int i = startI; i < endI; ++i) { for (int j = startJ; j < endJ; ++j) { if (i < 0 || j < 0) throw new ArgumentOutOfRangeException("Bad location of object" + physical.ToString()); output[i, j] = M; } } } } return output; }
public VehicleDrawer(GameObject gameObject) : base(gameObject) { }
public EffectDrawer(IObjectEffect _objectEffect, GameObject _gameObject) { objectEffect = _objectEffect; gameObject = _gameObject; }
public FireSmokeEffect(GameObject gameObject, Game game) { GameObject = gameObject; CreateParticleEmitter(game); }
public BuildingDrawer(GameObject gameObject) : base(gameObject) { }
public MiniModelDrawer(GameObject gameObject) { GameObject = gameObject; }
/// <summary> /// Dodaje obiekt i jego potomków do listy. /// </summary> /// <param name="gameObject">Obiekt do dodania</param> /// <param name="mission">Misja, do której obiekt jest wysyłany</param> public void AddGameObject(GameObject gameObject, Mission mission) { gameObject.Mission = mission; foreach (GameObject child in gameObject.GetChildren()) { child.Mission = mission; } gameObjects.Add(gameObject); gameObjects.AddRange(gameObject.GetChildren()); }
public StaticDrawer(GameObject gameObject) : base(gameObject) { }
public WaterEffectDrawer(IObjectEffect objectEffect, GameObject gameObject) : base(objectEffect,gameObject) { this.gameObject = gameObject; this.objectEffect = objectEffect; }
public WaterEffect(GameObject gameObject, Game game) { GameObject = gameObject; CreateParticleEmitter(game); }
public GameObjectDrawer(GameObject gameObject) { GameObject = gameObject; }
public PeopleDrawer(GameObject gameObject) : base(gameObject) { }