public SelectData(SelectScreen selectscreen, Input.ButtonMap buttonmap, TextSection textsection, String prefix, Boolean moveoverempty) { if (selectscreen == null) throw new ArgumentNullException("selectscreen"); if (buttonmap == null) throw new ArgumentNullException("buttonmap"); if (textsection == null) throw new ArgumentNullException("textsection"); if (prefix == null) throw new ArgumentNullException("prefix"); m_selectscreen = selectscreen; m_buttonmap = buttonmap; m_moveoverempty = moveoverempty; m_elements = new Elements.Collection(SelectScreen.SpriteManager, SelectScreen.AnimationManager, SelectScreen.SoundManager, SelectScreen.MenuSystem.FontMap); m_elements.Build("cursor.active", textsection, prefix + ".cursor.active"); m_elements.Build("cursor.done", textsection, prefix + ".cursor.done"); m_elements.Build("cursor.move", textsection, prefix + ".cursor.move"); m_elements.Build("random.move", textsection, prefix + ".random.move"); m_elements.Build("player.face", textsection, prefix + ".face"); m_elements.Build("player.name", textsection, prefix + ".name"); m_startcell = textsection.GetAttribute<Point>(prefix + ".cursor.startcell"); // X & Y seem to be reversed for this m_startcell = new Point(m_startcell.Y, m_startcell.X); Reset(); }
public SelectScreen(MenuSystem screensystem, TextSection textsection, String spritepath, String animationpath, String soundpath) : base(screensystem, textsection, spritepath, animationpath, soundpath) { m_selectmap = new Dictionary <Point, PlayerSelect>(); m_selectmovemap = new Dictionary <Point, PlayerSelect>(); m_gridsize = new Point(); m_gridsize.X = textsection.GetAttribute <Int32>("columns"); m_gridsize.Y = textsection.GetAttribute <Int32>("rows"); m_wrapping = textsection.GetAttribute <Boolean>("wrapping"); m_showemptyboxes = textsection.GetAttribute <Boolean>("showEmptyBoxes"); m_moveoveremptyboxes = textsection.GetAttribute <Boolean>("moveOverEmptyBoxes"); m_gridposition = textsection.GetAttribute <Point>("pos"); m_cellsize = textsection.GetAttribute <Point>("cell.size"); m_cellspacing = textsection.GetAttribute <Int32>("cell.spacing"); m_elements = new Elements.Collection(SpriteManager, AnimationManager, SoundManager, MenuSystem.FontMap); m_elements.Build(textsection, "cell.bg"); m_elements.Build(textsection, "cell.random"); m_cursorblinking = textsection.GetAttribute <Boolean>("p2.cursor.blink"); m_soundcancel = textsection.GetAttribute <SoundId>("cancel.snd"); m_titlelocation = textsection.GetAttribute <Point>("title.offset"); m_titlefont = textsection.GetAttribute <PrintData>("title.font"); m_stageposition = textsection.GetAttribute <Point>("stage.pos"); m_soundstagemove = textsection.GetAttribute <SoundId>("stage.move.snd"); m_soundstageselect = textsection.GetAttribute <SoundId>("stage.done.snd"); m_stagefont1 = textsection.GetAttribute <PrintData>("stage.active.font"); m_stagefont2 = textsection.GetAttribute <PrintData>("stage.active2.font"); m_stagedonefont = textsection.GetAttribute <PrintData>("stage.done.font"); m_randomswitchtime = textsection.GetAttribute <Int32>("cell.random.switchtime", 5); m_p1info = new SelectData(this, MenuSystem.GetSubSystem <Input.InputSystem>().CurrentInput[1], textsection, "p1", m_moveoveremptyboxes); m_p2info = new SelectData(this, MenuSystem.GetSubSystem <Input.InputSystem>().CurrentInput[2], textsection, "p2", m_moveoveremptyboxes); m_isdone = false; m_stagedisplaybuilder = new StringBuilder(); #warning Hack for now VersusMode = "Versus Mode"; }
public SelectData(SelectScreen selectscreen, Input.ButtonMap buttonmap, TextSection textsection, String prefix, Boolean moveoverempty) { if (selectscreen == null) { throw new ArgumentNullException("selectscreen"); } if (buttonmap == null) { throw new ArgumentNullException("buttonmap"); } if (textsection == null) { throw new ArgumentNullException("textsection"); } if (prefix == null) { throw new ArgumentNullException("prefix"); } m_selectscreen = selectscreen; m_buttonmap = buttonmap; m_moveoverempty = moveoverempty; m_elements = new Elements.Collection(SelectScreen.SpriteManager, SelectScreen.AnimationManager, SelectScreen.SoundManager, SelectScreen.MenuSystem.FontMap); m_elements.Build("cursor.active", textsection, prefix + ".cursor.active"); m_elements.Build("cursor.done", textsection, prefix + ".cursor.done"); m_elements.Build("cursor.move", textsection, prefix + ".cursor.move"); m_elements.Build("random.move", textsection, prefix + ".random.move"); m_elements.Build("player.face", textsection, prefix + ".face"); m_elements.Build("player.name", textsection, prefix + ".name"); m_startcell = textsection.GetAttribute <Point>(prefix + ".cursor.startcell"); // X & Y seem to be reversed for this m_startcell = new Point(m_startcell.Y, m_startcell.X); Reset(); }