internal override void Parse (XElement xe) { TargetFileName = xe.GetAttributeString ("TargetFileName"); ReplaceParameters = xe.GetAttributeBoolean ("ReplaceParameters", false); SubType = xe.GetAttributeString ("SubType"); CustomTool = xe.GetAttributeString ("CustomTool"); ItemType = xe.GetAttributeString ("ItemType"); Value = xe.Value; }
public PowerupBlock(XElement Source, Object pPersistenceData) : base(Source,pPersistenceData) { String sType = Source.GetAttributeString("PowerupType"); _releaseCount = Source.GetAttributeInt("ReleaseCount"); PowerupType = BCBlockGameState.FindClass(sType); }
internal override void Parse (XElement xe) { TargetFileName = xe.GetAttributeString ("TargetFileName"); ReplaceParameters = xe.GetAttributeBoolean ("ReplaceParameters", false); OpenInEditor = xe.GetAttributeBoolean ("OpenInEditor", false); OpenInWebBrowser = xe.GetAttributeBoolean ("OpenInWebBrowser", false); OpenInHelpBrowser = xe.GetAttributeBoolean ("OpenInHelpBrowser", false); OpenOrder = xe.GetAttributeInteger ("OpenOrder", 0); Value = xe.Value; }
public void SetMemento(XElement profileElement) { Id = Guid.Parse(profileElement.GetAttributeString("id")); Name = profileElement.GetAttributeString("name"); Decay = profileElement.GetAttributeUint("decay"); HasRestrictedHours = profileElement.GetAttributeBoolean("restrictedhours"); StartTime = profileElement.GetAttributeUint("starttime"); EndTime = profileElement.GetAttributeUint("endtime"); foreach (var stateElement in profileElement.Elements("state")) { var state = new ProfileState { BuildState = stateElement.GetAttributeEnum("name", BuildState.Unknown), Green = stateElement.GetAttributeBoolean("green"), Yellow = stateElement.GetAttributeBoolean("yellow"), Red = stateElement.GetAttributeBoolean("red"), Flash = stateElement.GetAttributeBoolean("flash"), Buzzer = stateElement.GetAttributeBoolean("buzzer") }; States.Add(state); } }
public void SetMemento(XElement deviceElement) { Id = Guid.Parse(deviceElement.GetAttributeString("id")); Name = deviceElement.GetAttributeString("name"); PhysicalDeviceId = deviceElement.GetAttributeString("physical-device-id"); ProfileId = deviceElement.GetAttributeGuid("profile-id"); }
public LevelSet(XElement Source, Object pPersistenceData) { SetName = Source.GetAttributeString("Name", ""); Levels = Source.ReadList("Levels", new List<Level>()); PathData = Source.ReadElement<ObjectPathDataManager>("PathData"); }
public Level(XElement SourceNode, Object pPersistenceData) { isloaded = true; Debug.Print("cLevel XML constructor"); MusicName = SourceNode.GetAttributeString("MusicName", null); LevelName = SourceNode.GetAttributeString("LevelName", "Default"); Description = SourceNode.GetAttributeString("Description", "Default"); MaxBalls = SourceNode.GetAttributeInt("MaxBalls", -1); LevelNameIntroTextFillColor = SourceNode.ReadElement("LevelNameIntroTextFillColor", Color.Black); LevelNameIntroTextPenColor = SourceNode.ReadElement("LevelnameIntroTextPenColor", Color.DodgerBlue); _LevelNameIntroFont = SourceNode.ReadElement("LevelNameIntroFont", new Font(BCBlockGameState.GetMonospaceFont(), 18)); TallyMusicName = SourceNode.GetAttributeString("TallyMusic"); TallyTickSound = SourceNode.GetAttributeString("TallyTickSound"); TallyPicKey = SourceNode.GetAttributeString("TallyPicKey"); GameOverMusic = SourceNode.GetAttributeString("GameOverMusic"); GameOverPicKey = SourceNode.GetAttributeString("GameOverPicKey"); IntroMusicName = SourceNode.GetAttributeString("IntroMusicName"); NextLevel = SourceNode.GetAttributeInt("NextLevel", -1); ShowNameLength = SourceNode.ReadElement<TimeSpan>("ShowNameLength"); levelblocks = StandardHelper.ReadList<Block>(SourceNode.Element("Blocks"),pPersistenceData); levelballs = StandardHelper.ReadList<cBall>(SourceNode.Element("Balls"),pPersistenceData); NoPaddle = SourceNode.GetAttributeBool("NoPaddle", false); PauseSound = SourceNode.GetAttributeString("PauseSound"); StartTrigger = SourceNode.GetAttributeInt("StartTrigger"); DeathSound = SourceNode.GetAttributeString("DeathSound", "mmdeath"); try { _SidebarColorMatrixValues = (float[][]) SourceNode.ReadArray<float[]>("SideBarColorMatrix", null,pPersistenceData); } catch (InvalidCastException) { } SidebarImageKey = SourceNode.GetAttributeString("SidebarImageKey"); SidebarTextColor = SourceNode.ReadElement<Color>("SidebarTextColor"); PauseImageKey = SourceNode.GetAttributeString("PauseImageKey"); try { _PauseColorMatrixValues = (float[][]) SourceNode.ReadArray<float[]>("PauseColorMatrix", null,pPersistenceData); } catch (InvalidCastException) { } PauseTextColor = SourceNode.ReadElement<Color>("PauseTextColor"); PauseFont = SourceNode.ReadElement<Font>("PauseFont"); LevelEvents = SourceNode.ReadList<TriggerEvent>("LevelEvents", null); try { _AvailablePowerups = BCBlockGameState.StringToTypes(SourceNode.ReadList<String>("AvailablePowerups",null,pPersistenceData)).ToList(); } catch { _AvailablePowerups = GamePowerUp.GetPowerUpTypes().ToList(); } MessageData = SourceNode.ReadList<PlayMessageData>("MessageData",null,pPersistenceData); try { Background = SourceNode.ReadElement<BackgroundDrawer>("Background", new BackgroundColourImageDrawer(Color.White),pPersistenceData); } catch { Background = new BackgroundColourImageDrawer(Color.Gray); } ClearTitle = SourceNode.GetAttributeString("ClearTitle", " SCORE \n"); }
public SwitchStateData(XElement Source, Object pPersistenceData) { InvokeID = Source.GetAttributeInt("InvokeID"); HitSound = Source.GetAttributeString("HitSound"); StateColor = Color.FromArgb(Source.GetAttributeInt("StateColor")); }
public Memento(XElement element) { Element = element; Key = element.GetAttributeString("key"); Type = element.GetAttributeString("type"); }
public TimedBehaviour(XElement Source, Object pPersistenceData) { Span = Source.ReadElement("Span", new TimeSpan(0, 0, 0, 1)); String grabtype = Source.GetAttributeString("useBehaviour"); useBehaviour = BCBlockGameState.FindClass(grabtype); }
public ParticleEmitterBehaviour(XElement Source, Object pPersistenceData) : base(Source,pPersistenceData) { String sParticleType = Source.GetAttributeString("ParticleType","DustParticle"); _ParticleType = BCBlockGameState.FindClass(sParticleType); if (_ParticleType == null) _ParticleType = typeof(DustParticle); }
public SwitchBlock(XElement Source, Object pPersistenceData) : base(Source,pPersistenceData) { ActiveSound = Source.GetAttributeString("ActiveSound"); InactiveSound = Source.GetAttributeString("InactiveSound"); ActiveColor = Color.FromArgb(Source.GetAttributeInt("ActiveColor")); InactiveColor = Color.FromArgb(Source.GetAttributeInt("InactiveColor")); Active = Source.GetAttributeBool("Active"); AllActiveID = Source.GetAttributeInt("AllActiveID"); AllInactiveID = Source.GetAttributeInt("AllInactiveID"); }
public EditorSet(XElement Source, Object pPersistenceData) { String sVersion = Source.GetAttributeString("Version"); CreateData = Source.ReadElement<CreatorProperties>("CreatorProperties",null, pPersistenceData); LevelData = Source.ReadElement<LevelSet>("LevelSet",null,pPersistenceData); }
public ImageDataItem(XElement SourceItem) { //Name attribute... String sName = SourceItem.GetAttributeString("Name"); Image sImage = (Image)SourceItem.ReadElement(typeof(Image), "ImageData", null); if(sImage==null || sName==null) throw new InvalidDataException("Name or Image is null loading ImageDataItem"); Name = sName; ImageData = sImage; }
public CreatorProperties(XElement Source, Object pPersistenceData) { //retrieve Attributes... Author = Source.GetAttributeString("Author", String.Empty); Version = Source.GetAttributeString("Version", String.Empty); Comment = Source.GetAttributeString("Comment", String.Empty); isTemplate = Source.GetAttributeBool("isTemplate", false); Description = Source.GetAttributeString("Description", Description); SavedImages = Source.ReadDictionary("SavedImages", new Dictionary<String, ImageDataItem>()); SavedSounds = Source.ReadDictionary("SavedSounds", new Dictionary<String, SoundDataItem>()); SavedScripts = Source.ReadDictionary("SavedScripts", new Dictionary<String, ScriptDataItem>()); }