Example #1
0
		public RoundInformation(FightEngine engine, IO.TextFile file)
			: base(engine)
		{
			if (file == null) throw new ArgumentNullException("file");

			IO.TextSection roundsection = file.GetSection("Round");
			IO.TextSection powerbarsection = file.GetSection("Powerbar");

            var elements = Engine.Elements;

            elements.Build(roundsection, "round.default");
            elements.Build(roundsection, "round");
            elements.Build(roundsection, "round1");
            elements.Build(roundsection, "round2");
            elements.Build(roundsection, "round3");
            elements.Build(roundsection, "round4");
            elements.Build(roundsection, "round5");
            elements.Build(roundsection, "round6");
            elements.Build(roundsection, "round7");
            elements.Build(roundsection, "round8");
            elements.Build(roundsection, "round9");
            elements.Build(roundsection, "fight");
            elements.Build(roundsection, "KO");
            elements.Build(roundsection, "DKO");
            elements.Build(roundsection, "TO");
            elements.Build(roundsection, "win");
            elements.Build(roundsection, "win2");
            elements.Build(roundsection, "draw");

            elements.Build(powerbarsection, "level1");
            elements.Build(powerbarsection, "level2");
            elements.Build(powerbarsection, "level3");
            elements.Build(powerbarsection, "level4");
            elements.Build(powerbarsection, "level5");
            elements.Build(powerbarsection, "level6");
            elements.Build(powerbarsection, "level7");
            elements.Build(powerbarsection, "level8");
            elements.Build(powerbarsection, "level9");

			m_roundsforwin = roundsection.GetAttribute<Int32>("match.wins");
			m_maxdrawgames = roundsection.GetAttribute<Int32>("match.maxdrawgames");
			m_introdelay = roundsection.GetAttribute<Int32>("start.waittime");
			m_defaultlocation = (Vector2)roundsection.GetAttribute<Point>("pos");
			m_rounddisplaytime = roundsection.GetAttribute<Int32>("round.time");
			m_controltime = roundsection.GetAttribute<Int32>("ctrl.time");
			m_koslowtime = roundsection.GetAttribute<Int32>("slow.time");
			m_overwaittime = roundsection.GetAttribute<Int32>("over.waittime");
			m_overhittime = roundsection.GetAttribute<Int32>("over.hittime");
			m_overwintime = roundsection.GetAttribute<Int32>("over.wintime");
			m_overtime = roundsection.GetAttribute<Int32>("over.time");
			m_wintime = roundsection.GetAttribute<Int32>("win.time");

			m_roundnumbers = BuildRoundNumbersSoundMap();
		}