public EnemyType(EnemyType t) { fname = t.fname; Health = t.Health; ShootInterval = t.ShootInterval; shootDir = t.shootDir; moveDir = t.moveDir; CanMoveOut = t.CanMoveOut; Points = t.Points; Width = t.Width; Height = t.Height; }
//File: //timeTillBoss (ms) //enemyInterval(ms) //<enemytype1>fname|health|shootint.(ms)|shoot,dir|move,dir|(0 or 1)canmoveout|points //<enemytype2>.... public StageLogic(string fname) { using(StreamReader sr = new StreamReader(fname)) { string file = sr.ReadToEnd(); string[] lines = file.Split('\n'); this.timeTillBoss = double.Parse(lines[0]); this.enemyInterval = double.Parse(lines[1]); EnemyType weak = new EnemyType(lines[2]); EnemyType normal = new EnemyType(lines[3]); EnemyType strong = new EnemyType(lines[4]); Enemies = new Dictionary<EnemyTypeEnum, EnemyType>() { {EnemyTypeEnum.Weak, weak }, {EnemyTypeEnum.Normal, normal }, {EnemyTypeEnum.Strong, strong } }; } }
public EnemyBl(EnemyModel em, EnemyType t) { base.shape = em; this.etype = t; }