public TeamDisplay(Team team) { if (team == null) throw new ArgumentNullException("team"); m_team = team; m_combocounter = new ComboCounter(team); IO.TextFile textfile = m_team.Engine.GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def"); IO.TextSection lifebar = textfile.GetSection("Lifebar"); IO.TextSection powerbar = textfile.GetSection("Powerbar"); IO.TextSection face = textfile.GetSection("Face"); IO.TextSection name = textfile.GetSection("Name"); IO.TextSection winicon = textfile.GetSection("WinIcon"); String prefix = Misc.GetPrefix(m_team.Side); var elements = m_team.Engine.Elements; m_lifebg0 = elements.Build(prefix + "lifebar.bg0", lifebar, prefix + ".bg0"); m_lifebg1 = elements.Build(prefix + "lifebar.bg1", lifebar, prefix + ".bg1"); m_lifebg2 = elements.Build(prefix + "lifebar.bg2", lifebar, prefix + ".bg2"); m_lifemid = elements.Build(prefix + "lifebar.mid", lifebar, prefix + ".mid"); m_lifefront = elements.Build(prefix + "lifebar.front", lifebar, prefix + ".front"); m_powerbg0 = elements.Build(prefix + "powerbar.bg0", powerbar, prefix + ".bg0"); m_powerbg1 = elements.Build(prefix + "powerbar.bg1", powerbar, prefix + ".bg1"); m_powerbg2 = elements.Build(prefix + "powerbar.bg2", powerbar, prefix + ".bg2"); m_powermid = elements.Build(prefix + "powerbar.mid", powerbar, prefix + ".mid"); m_powerfront = elements.Build(prefix + "powerbar.front", powerbar, prefix + ".front"); m_powercounter = elements.Build(prefix + "powerbar.counter", powerbar, prefix + ".counter"); m_facebg = elements.Build(prefix + "face.bg", face, prefix + ".bg"); m_faceimage = elements.Build(prefix + "face.face", face, prefix + ".face"); m_namelement = elements.Build(prefix + "name.name", name, prefix + ".name"); m_winiconnormal = elements.Build(prefix + "winicon.normal", winicon, prefix + ".n"); m_winiconspecial = elements.Build(prefix + "winicon.special", winicon, prefix + ".s"); m_winiconhyper = elements.Build(prefix + "winicon.hyper", winicon, prefix + ".h"); m_winiconthrow = elements.Build(prefix + "winicon.normalthrow", winicon, prefix + ".throw"); m_winiconcheese = elements.Build(prefix + "winicon.cheese", winicon, prefix + ".c"); m_winicontime = elements.Build(prefix + "winicon.timeout", winicon, prefix + ".t"); m_winiconsuicide = elements.Build(prefix + "winicon.suicide", winicon, prefix + ".suicide"); m_winiconteammate = elements.Build(prefix + "winicon.teammate", winicon, prefix + ".teammate"); m_winiconperfect = elements.Build(prefix + "winicon.perfect", winicon, prefix + ".perfect"); m_lifebarposition = (Vector2)lifebar.GetAttribute<Point>(prefix + ".pos"); m_lifebarrange = lifebar.GetAttribute<Point>(prefix + ".range.x"); m_powerbarposition = (Vector2)powerbar.GetAttribute<Point>(prefix + ".pos"); m_powerbarrange = powerbar.GetAttribute<Point>(prefix + ".range.x"); m_faceposition = (Vector2)face.GetAttribute<Point>(prefix + ".pos"); m_nameposition = (Vector2)name.GetAttribute<Point>(prefix + ".pos"); m_winiconposition = (Vector2)winicon.GetAttribute<Point>(prefix + ".pos"); m_winiconoffset = (Vector2)winicon.GetAttribute<Point>(prefix + ".iconoffset"); }
public void Update() { if (m_team.Mode == TeamMode.Turns) { var player = m_team.OtherTeam.Wins.Count == 1 ? m_team.TeamMate : m_team.MainPlayer; m_lifebar.Update(player); } else { m_lifebar.Update(m_team.MainPlayer); m_mateLifebar?.Update(m_team.TeamMate); } ComboCounter.Update(); }
public TeamDisplay(Team team) { if (team == null) { throw new ArgumentNullException(nameof(team)); } m_team = team; m_combocounter = new ComboCounter(team); var textfile = m_team.Engine.GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def"); var lifebar = textfile.GetSection(GetLifebarSectionName(team.Mode)); var powerbar = textfile.GetSection("Powerbar"); var face = textfile.GetSection(GetFaceSectionName(team.Mode)); var name = textfile.GetSection(GetNameSectionName(team.Mode)); var winicon = textfile.GetSection("WinIcon"); var prefix = Misc.GetPrefix(m_team.Side); var matePrefix = Misc.GetMatePrefix(m_team.Mode, m_team.Side); var elements = m_team.Engine.Elements; var lifebg0 = elements.Build(prefix + "lifebar.bg0", lifebar, prefix + ".bg0"); var lifebg1 = elements.Build(prefix + "lifebar.bg1", lifebar, prefix + ".bg1"); var lifemid = elements.Build(prefix + "lifebar.mid", lifebar, prefix + ".mid"); var lifefront = elements.Build(prefix + "lifebar.front", lifebar, prefix + ".front"); if (team.Mode == TeamMode.Simul) { var mateLifebg0 = elements.Build(matePrefix + "lifebar.bg0", lifebar, matePrefix + ".bg0"); var mateLifebg1 = elements.Build(matePrefix + "lifebar.bg1", lifebar, matePrefix + ".bg1"); var mateLifemid = elements.Build(matePrefix + "lifebar.mid", lifebar, matePrefix + ".mid"); var mateLifefront = elements.Build(matePrefix + "lifebar.front", lifebar, matePrefix + ".front"); var mateLifebarPosition = (Vector2)lifebar.GetAttribute <Point>(matePrefix + ".pos"); var mateLifeBarRange = lifebar.GetAttribute <Point>(matePrefix + ".range.x"); m_mateLifebar = new Lifebar(mateLifebg0, mateLifebg1, mateLifemid, mateLifefront, mateLifebarPosition, mateLifeBarRange); } m_powerbg0 = elements.Build(prefix + "powerbar.bg0", powerbar, prefix + ".bg0"); m_powerbg1 = elements.Build(prefix + "powerbar.bg1", powerbar, prefix + ".bg1"); m_powermid = elements.Build(prefix + "powerbar.mid", powerbar, prefix + ".mid"); m_powerfront = elements.Build(prefix + "powerbar.front", powerbar, prefix + ".front"); m_powercounter = elements.Build(prefix + "powerbar.counter", powerbar, prefix + ".counter"); m_facebg = elements.Build(prefix + "face.bg", face, prefix + ".bg"); m_faceimage = elements.Build(prefix + "face.face", face, prefix + ".face"); if (team.Mode == TeamMode.Simul || team.Mode == TeamMode.Turns) { m_mateFaceBg = elements.Build(matePrefix + "face.bg", face, matePrefix + ".bg"); m_mateFaceImage = elements.Build(matePrefix + "face.face", face, matePrefix + ".face"); m_mateFaceKo = elements.Build(matePrefix + "face.ko", face, matePrefix + ".ko"); m_mateFacePosition = (Vector2)face.GetAttribute <Point>(matePrefix + ".pos"); } m_namelement = elements.Build(prefix + "name.name", name, prefix + ".name"); if (team.Mode == TeamMode.Simul) { m_mateNameElement = elements.Build(matePrefix + "name.name", name, matePrefix + ".name"); m_mateNamePosition = (Vector2)name.GetAttribute <Point>(matePrefix + ".pos"); } m_winiconnormal = elements.Build(prefix + "winicon.normal", winicon, prefix + ".n"); m_winiconspecial = elements.Build(prefix + "winicon.special", winicon, prefix + ".s"); m_winiconhyper = elements.Build(prefix + "winicon.hyper", winicon, prefix + ".h"); m_winiconthrow = elements.Build(prefix + "winicon.normalthrow", winicon, prefix + ".throw"); m_winiconcheese = elements.Build(prefix + "winicon.cheese", winicon, prefix + ".c"); m_winicontime = elements.Build(prefix + "winicon.timeout", winicon, prefix + ".t"); m_winiconsuicide = elements.Build(prefix + "winicon.suicide", winicon, prefix + ".suicide"); m_winiconteammate = elements.Build(prefix + "winicon.teammate", winicon, prefix + ".teammate"); m_winiconperfect = elements.Build(prefix + "winicon.perfect", winicon, prefix + ".perfect"); var lifebarposition = (Vector2)lifebar.GetAttribute <Point>(prefix + ".pos"); var lifebarrange = lifebar.GetAttribute <Point>(prefix + ".range.x"); m_powerbarposition = (Vector2)powerbar.GetAttribute <Point>(prefix + ".pos"); m_powerbarrange = powerbar.GetAttribute <Point>(prefix + ".range.x"); m_faceposition = (Vector2)face.GetAttribute <Point>(prefix + ".pos"); m_nameposition = (Vector2)name.GetAttribute <Point>(prefix + ".pos"); m_winiconposition = (Vector2)winicon.GetAttribute <Point>(prefix + ".pos"); m_winiconoffset = (Vector2)winicon.GetAttribute <Point>(prefix + ".iconoffset"); m_lifebar = new Lifebar(lifebg0, lifebg1, lifemid, lifefront, lifebarposition, lifebarrange); }
public TeamDisplay(Team team) { if (team == null) { throw new ArgumentNullException("team"); } m_team = team; m_combocounter = new ComboCounter(team); IO.TextFile textfile = m_team.Engine.GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def"); IO.TextSection lifebar = textfile.GetSection("Lifebar"); IO.TextSection powerbar = textfile.GetSection("Powerbar"); IO.TextSection face = textfile.GetSection("Face"); IO.TextSection name = textfile.GetSection("Name"); IO.TextSection winicon = textfile.GetSection("WinIcon"); String prefix = Misc.GetPrefix(m_team.Side); var elements = m_team.Engine.Elements; m_lifebg0 = elements.Build(prefix + "lifebar.bg0", lifebar, prefix + ".bg0"); m_lifebg1 = elements.Build(prefix + "lifebar.bg1", lifebar, prefix + ".bg1"); m_lifebg2 = elements.Build(prefix + "lifebar.bg2", lifebar, prefix + ".bg2"); m_lifemid = elements.Build(prefix + "lifebar.mid", lifebar, prefix + ".mid"); m_lifefront = elements.Build(prefix + "lifebar.front", lifebar, prefix + ".front"); m_powerbg0 = elements.Build(prefix + "powerbar.bg0", powerbar, prefix + ".bg0"); m_powerbg1 = elements.Build(prefix + "powerbar.bg1", powerbar, prefix + ".bg1"); m_powerbg2 = elements.Build(prefix + "powerbar.bg2", powerbar, prefix + ".bg2"); m_powermid = elements.Build(prefix + "powerbar.mid", powerbar, prefix + ".mid"); m_powerfront = elements.Build(prefix + "powerbar.front", powerbar, prefix + ".front"); m_powercounter = elements.Build(prefix + "powerbar.counter", powerbar, prefix + ".counter"); m_facebg = elements.Build(prefix + "face.bg", face, prefix + ".bg"); m_faceimage = elements.Build(prefix + "face.face", face, prefix + ".face"); m_namelement = elements.Build(prefix + "name.name", name, prefix + ".name"); m_winiconnormal = elements.Build(prefix + "winicon.normal", winicon, prefix + ".n"); m_winiconspecial = elements.Build(prefix + "winicon.special", winicon, prefix + ".s"); m_winiconhyper = elements.Build(prefix + "winicon.hyper", winicon, prefix + ".h"); m_winiconthrow = elements.Build(prefix + "winicon.normalthrow", winicon, prefix + ".throw"); m_winiconcheese = elements.Build(prefix + "winicon.cheese", winicon, prefix + ".c"); m_winicontime = elements.Build(prefix + "winicon.timeout", winicon, prefix + ".t"); m_winiconsuicide = elements.Build(prefix + "winicon.suicide", winicon, prefix + ".suicide"); m_winiconteammate = elements.Build(prefix + "winicon.teammate", winicon, prefix + ".teammate"); m_winiconperfect = elements.Build(prefix + "winicon.perfect", winicon, prefix + ".perfect"); m_lifebarposition = (Vector2)lifebar.GetAttribute <Point>(prefix + ".pos"); m_lifebarrange = lifebar.GetAttribute <Point>(prefix + ".range.x"); m_powerbarposition = (Vector2)powerbar.GetAttribute <Point>(prefix + ".pos"); m_powerbarrange = powerbar.GetAttribute <Point>(prefix + ".range.x"); m_faceposition = (Vector2)face.GetAttribute <Point>(prefix + ".pos"); m_nameposition = (Vector2)name.GetAttribute <Point>(prefix + ".pos"); m_winiconposition = (Vector2)winicon.GetAttribute <Point>(prefix + ".pos"); m_winiconoffset = (Vector2)winicon.GetAttribute <Point>(prefix + ".iconoffset"); }
public void Update() { ComboCounter.Update(); }