public void Initialize() { CSVReader csvReader = new CSVReader(); csvReader.Read("wave1.csv"); eL1List = new List <Enemy>(); parser = new EnemyCSVParser(camp, players, walls, unchis, glasses); var dataList = parser.Parse("wave1.csv", "./"); foreach (var data in dataList) { eL1List.Add(data); } foreach (var el1 in eL1List) { el1.Initialize(); } waveDays = new Vector2(50, 800); waveDaysMid = new Vector2(475, 350); alpha = 1.0f; }
public void Initialize() { CSVReader csvReader = new CSVReader(); csvReader.Read("spawn1.csv"); eL1List = new List <Enemy>(); parser = new EnemyCSVParser(camp, players, walls, unchis, glasses); var dataList = parser.Parse("spawn1.csv", "./"); foreach (var data in dataList) { //eL1List.Add(data); } foreach (var el1 in eL1List) { el1.Initialize(); } }
/// <summary> /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる) /// </summary> protected override void Initialize() { // この下にロジックを記述 gameDevice = GameDevice.Instance(Content, GraphicsDevice); bgmLoader = new BGMLoader(new string[, ] { { "gamePlay", "./Sound/" } }); CSVReader csvReader = new CSVReader(); csvReader.Read("spawn.csv"); unchis = new List <Unchi>(); player = new Player(); camp = new Camp(); players = new List <Player>(); players.Add(player); wall = new Wall(new Vector2(700, 200), new Rectangle(0, 0, 10 * 50, 1 * 50)); walls = new List <Wall>(); walls.Add(wall); walls.Add(new Wall(new Vector2(500, 400), new Rectangle(0, 0, 2 * 50, 5 * 50))); walls.Add(new Wall(new Vector2(700, 800), new Rectangle(0, 0, 8 * 50, 1 * 50))); walls.Add(new Wall(new Vector2(1200, 400), new Rectangle(0, 0, 2 * 50, 5 * 50))); foreach (var wa in walls) { wa.Initialize(); } Top = new EnemyLevel1(Direction.TOP, camp, players, walls, 0, unchis); Bottom = new EnemyLevel1(Direction.BOTTOM, camp, players, walls, 1, unchis); Right = new EnemyLevel1(Direction.RIGHT, camp, players, walls, 5, unchis); Left = new EnemyLevel1(Direction.LEFT, camp, players, walls, 9, unchis); eL1List = new List <EnemyLevel1>(); eL1List.Add(Top); eL1List.Add(Bottom); eL1List.Add(Right); eL1List.Add(Left); EnemyCSVParser parser = new EnemyCSVParser(camp, players, walls, unchis); var dataList = parser.Parse("spawn.csv", "./"); foreach (var data in dataList) { eL1List.Add(data); } foreach (var el1 in eL1List) { el1.Initialze(); } // この上にロジックを記述 base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!! }