public FightEngine(SubSystems subsystems) : base(subsystems) { var textfile = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def"); var filesection = textfile.GetSection("Files"); var basepath = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath); Entities = new EntityCollection(this); Pause = new Pause(this, false); SuperPause = new Pause(this, true); Assertions = new EngineAssertions(); Camera = new Camera(this); EnvironmentColor = new EnvironmentColor(this); EnvironmentShake = new EnvironmentShake(this); Speed = GameSpeed.Normal; Fonts = BuildFontMap(filesection); FightSounds = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("snd"))); CommonSounds = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("common.snd"))); FightSprites = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("sff"))); FxSprites = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.sff"))); FightAnimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath); FxAnimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.air"))); Elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts); RoundInformation = new RoundInformation(this, textfile); Team1 = new Team(this, TeamSide.Left); Team2 = new Team(this, TeamSide.Right); m_combatcheck = new CombatChecker(this); m_logic = new Logic.PreIntro(this); Clock = new Clock(this); }
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(); }
public FightEngine(SubSystems subsystems) : base(subsystems) { IO.TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def"); IO.TextSection filesection = textfile.GetSection("Files"); String basepath = GetSubSystem<IO.FileSystem>().GetDirectory(textfile.Filepath); m_init = null; m_entities = new EntityCollection(this); m_roundnumber = 0; m_stage = null; m_idcounter = 0; m_tickcount = 0; m_pause = new Pause(this, false); m_superpause = new Pause(this, true); m_asserts = new EngineAssertions(); m_camera = new Camera(this); m_envcolor = new EnvironmentColor(this); m_envshake = new EnvironmentShake(this); m_speed = GameSpeed.Normal; m_slowspeedbuffer = 0; m_fontmap = BuildFontMap(filesection); m_fightsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("snd"))); m_commonsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("common.snd"))); m_fightsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("sff"))); m_fxsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.sff"))); m_fightanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(textfile.Filepath); m_fxanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.air"))); m_elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts); m_roundinfo = new RoundInformation(this, textfile); m_team1 = new Team(this, TeamSide.Left); m_team2 = new Team(this, TeamSide.Right); m_combatcheck = new CombatChecker(this); m_logic = new Logic.PreIntro(this); m_clock = new Clock(this); }
public FightEngine(SubSystems subsystems) : base(subsystems) { IO.TextFile textfile = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def"); IO.TextSection filesection = textfile.GetSection("Files"); String basepath = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath); m_init = null; m_entities = new EntityCollection(this); m_roundnumber = 0; m_stage = null; m_idcounter = 0; m_tickcount = 0; m_pause = new Pause(this, false); m_superpause = new Pause(this, true); m_asserts = new EngineAssertions(); m_camera = new Camera(this); m_envcolor = new EnvironmentColor(this); m_envshake = new EnvironmentShake(this); m_speed = GameSpeed.Normal; m_slowspeedbuffer = 0; m_fontmap = BuildFontMap(filesection); m_fightsounds = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("snd"))); m_commonsounds = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("common.snd"))); m_fightsprites = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("sff"))); m_fxsprites = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.sff"))); m_fightanimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath); m_fxanimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.air"))); m_elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts); m_roundinfo = new RoundInformation(this, textfile); m_team1 = new Team(this, TeamSide.Left); m_team2 = new Team(this, TeamSide.Right); m_combatcheck = new CombatChecker(this); m_logic = new Logic.PreIntro(this); m_clock = new Clock(this); }