public Room(string fileName) { var strings = File.ReadAllLines("Rooms/" + fileName); _form = new RectangleF(float.Parse(strings[0]), float.Parse(strings[1]), float.Parse(strings[2]), float.Parse(strings[3])); _border = new RoomBorder(float.Parse(strings[4]), float.Parse(strings[5]), int.Parse(strings[6])); _texture = int.Parse(strings[7]); for (var i = 0; i < int.Parse(strings[8]); i++) { var x = float.Parse(strings[9 + 3 * i]); var y = float.Parse(strings[10 + 3 * i]); var name = strings[11 + 3 * i]; var enemy = new Enemy(x, y, name); _enemies.Add(enemy); _enemyControllers[enemy] = new DefaultEnemyController(enemy, this); } }
public Room(RectangleF form, int texture) { _form = form; _texture = texture; _border = new RoomBorder(0.15f, 0.15f, 0); }