protected virtual void Dispose(bool disposing) { Models.Clear(); Players.Clear(); Sounds.Clear(); States.Clear(); }
protected override bool DoTurn(Turn turn) { double deltaT = Arena.Time - lastTime; if (Velocity != Vector2D.NullVector()) { bool result = Arena.MoveObject(this, Position + Velocity * deltaT); if (!result) { //If you hit something, your velocity goes to zero Velocity = Vector2D.NullVector(); } } double staminaLost = StaminaRate(Velocity.Magnitude) * deltaT; if (staminaLost > 0) { Stamina -= staminaLost; Stamina = Math.Max(0, Stamina); } else { Stamina += Stats.StaminaRestoredPerSecond * deltaT; Stamina = Math.Min(Stamina, Stats.MaxStamina); } if (turn == null) { return(false); } Sounds.Clear(); return(turn.DoTurn()); }
public override void Clear() { Restrictions.Clear(); Rules.Clear(); Sounds.Clear(); PetGiveDamageScalar = DefPetGiveDamageScalar; PetTakeDamageScalar = DefPetTakeDamageScalar; }
private void BackButton_OnClick(object sender, RoutedEventArgs e) { Sounds.Clear(); foreach (var item in SoundItemManager.GenerateSounds()) { Sounds.Add(item); } BackButton.Visibility = Visibility.Collapsed; }
public override void OnRemovedFromEntity() { foreach (var sound in CurrentlyPlayingSoundEffects) { sound.Stop(); } CurrentlyPlayingSoundEffects.Clear(); Sounds.Clear(); }
public override void Clear() { Broadcasts.Clear(); Locations.Clear(); Restrictions.Clear(); Rewards.Clear(); Rules.Clear(); Sounds.Clear(); SuddenDeath.Clear(); Timing.Clear(); Weather.Clear(); }
void Clear() { foreach (var texturesValue in Textures.Values) { ((Texture2D)texturesValue).Dispose(); } Textures.Clear(); Sounds.Clear(); Fonts.Clear(); Music.Clear(); MonoContentManager.Unload(); }
public void Reset() { StopAllSounds(); Sounds.Clear(); foreach (List <SoundInstance> si in instances.Values) { for (int i = 0; i < si.Count; i++) { si[i].Dispose(); } si.Clear(); } instances.Clear(); }
/// <summary> /// Removes all light objects. /// </summary> public void Clear() { WaterPlanes.Clear(); Objects.Clear(); NPCs.Clear(); Buildings.Clear(); Sounds.Clear(); Effects.Clear(); Animations.Clear(); MonsterSpawns.Clear(); WarpPoints.Clear(); CollisionObjects.Clear(); EventObjects.Clear(); }
private void MenuListView_OnItemClick(object sender, ItemClickEventArgs e) { var itemSelected = e.ClickedItem as MenuItem; if (itemSelected == null) { return; } Sounds.Clear(); foreach (var item in SoundItemManager.GenerateSounds(itemSelected.Category)) { Sounds.Add(item); } BackButton.Visibility = Visibility.Visible; }
public void Clear() { IsUpdate = false; VoiceType = PlayerInformation.Info.PType; BehType = BehaviorType.None; Targets.Clear(); Damages.Clear(); Abnormals.Clear(); IsHit.Clear(); //IsDeath.Clear(); KillList.Clear(); Effects.Clear(); Sounds.Clear(); Voices.Clear(); Messages.Clear(); }
public static void Clear() { Wheels.Clear(); GoodsId.Clear(); Goods.Clear(); GoodsBundle.Clear(); Store.Clear(); Inventory.Clear(); Sound.Clear(); Sounds.Clear(); Question.Clear(); Degree.Clear(); AdChannelPostfix.Clear(); DailyTarget.Clear(); Language.Clear(); GameConst.Clear(); }
private void DoOpenPlaylist(object obj) { if (!string.IsNullOrEmpty(SelectedPlaylist.Path)) { var soundList = new List <Sound>(); var allFiles = File.ReadAllLines(SelectedPlaylist.Path); for (int i = 0; i < allFiles.Length - 1; i = i + 2) { soundList.Add(new Sound() { Path = allFiles[i], Name = allFiles[i + 1] }); } Sounds.Clear(); soundList.ForEach(c => Sounds.Add(c)); SetDefaultPlaylist(SelectedPlaylist.Path); } }
public override void Dispose() { base.Dispose(); FMOD.RESULT result; foreach (var snd in Sounds) { if (snd != null) { snd.release(); } } Sounds.Clear(); if (FModSystem != null) { result = FModSystem.close(); ERRCHECK(result); result = FModSystem.release(); ERRCHECK(result); } }
//Fills ObservableCollection<Sound> Sounds with files found in directory pointed by dirPath. private void FillSoundsDirectory(string dirPath) { if (!string.IsNullOrEmpty(dirPath)) { var allFiles = Directory.GetFiles(dirPath); var soundList = new List <Sound>(); foreach (var file in allFiles) { var pathExtension = Path.GetExtension(file); if (pathExtension?.ToUpper() == ".MP3") { soundList.Add(new Sound() { Name = Path.GetFileNameWithoutExtension(file), Path = file }); } } Sounds.Clear(); soundList.ForEach(c => Sounds.Add(c)); } }
public void Clear() { sounds.Clear(); if (sky != null) { sky.Clear(); } world = null; water = null; models = null; sky = null; //destroy map if (mapParent != null) { UnityEngine.Object.Destroy(mapParent); mapParent = null; } //destroy textures var ob = UnityEngine.Object.FindObjectsOfType(typeof(Texture2D)); int dCount = 0; foreach (Texture2D t in ob) { if (t.name.StartsWith("maptexture@")) { dCount++; UnityEngine.Object.Destroy(t); } } Debug.Log(dCount + " textures destroyed"); worldCompleted = altitudeCompleted = groundCompleted = modelsCompleted = false; }
public void ClearFiles() { Sounds.Clear(); }
public override void Load(BinaryReader reader, int size) { scriptGameVersion = 2; var sk = reader.BaseStream.Position; UnkBitfield = reader.ReadUInt32(); /* * for (int i = 0; i < 8; ++i) * { * ScriptSlots[i] = reader.ReadByte(); * } */ var Count_OGI = reader.ReadByte(); var Count_Anim = Count_OGI; var Count_Script = reader.ReadByte(); var Count_GameObject = reader.ReadByte(); var Count_UnkI32 = reader.ReadByte(); //reader.ReadUInt32(); var Count_Sound = reader.ReadUInt32(); //Class1 = reader.ReadUInt32(); //Class2 = reader.ReadUInt32(); //Class3 = reader.ReadUInt32(); var len = reader.ReadInt32(); Name = new string(reader.ReadChars(len)); // Read UInt32 script slots UI32.Clear(); for (int i = 0; i < Count_UnkI32; ++i) { UI32.Add(reader.ReadUInt32()); } // Read OGI script slots OGIs.Clear(); for (int i = 0; i < Count_OGI; ++i) { OGIs.Add(reader.ReadUInt16()); } // Read Animation script slots Anims.Clear(); for (int i = 0; i < Count_Anim; ++i) { Anims.Add(reader.ReadUInt16()); } // Read Script script slots Scripts.Clear(); for (int i = 0; i < Count_Script; ++i) { Scripts.Add(reader.ReadUInt16()); } // Read Object script slots Objects.Clear(); for (int i = 0; i < Count_GameObject; ++i) { Objects.Add(reader.ReadUInt16()); } // Read Sound script slots Sounds.Clear(); for (int i = 0; i < Count_Sound; ++i) { Sounds.Add(reader.ReadUInt16()); } // Read instance properties if ((UnkBitfield & 0x20000000) != 0x0) { //PHeader = reader.ReadUInt32(); //reader.BaseStream.Position -= 4; var Count_Flags = reader.ReadByte(); var Count_Floats = reader.ReadByte(); var Count_Ints = reader.ReadByte(); reader.ReadByte(); PUI32 = reader.ReadUInt32(); instFlagsList.Clear(); for (int i = 0; i < Count_Flags; ++i) { instFlagsList.Add(reader.ReadUInt32()); } instFloatsList.Clear(); for (int i = 0; i < Count_Floats; ++i) { instFloatsList.Add(reader.ReadSingle()); } instIntegerList.Clear(); for (int i = 0; i < Count_Ints; ++i) { instIntegerList.Add(reader.ReadUInt32()); } } else { //PHeader = 0; PUI32 = 0; instFlagsList.Clear(); instFloatsList.Clear(); instIntegerList.Clear(); } // Read IDs needed for instance creation if ((UnkBitfield & 0x40000000) != 0x0) { flag = reader.ReadUInt32(); if ((flag & 0x00000001) != 0) { var cnt = reader.ReadInt32(); cObjects.Clear(); for (int i = 0; i < cnt; ++i) { cObjects.Add(reader.ReadUInt16()); } } if ((flag & 0x00000002) != 0) { var cnt = reader.ReadInt32(); cOGIs.Clear(); for (int i = 0; i < cnt; ++i) { cOGIs.Add(reader.ReadUInt16()); } } if ((flag & 0x00000004) != 0) { var cnt = reader.ReadInt32(); cAnims.Clear(); for (int i = 0; i < cnt; ++i) { cAnims.Add(reader.ReadUInt16()); } } if ((flag & 0x00000008) != 0) { var cnt = reader.ReadInt32(); cCM.Clear(); for (int i = 0; i < cnt; ++i) { cCM.Add(reader.ReadUInt16()); } } if ((flag & 0x00000010) != 0) { var cnt = reader.ReadInt32(); cScripts.Clear(); for (int i = 0; i < cnt; ++i) { cScripts.Add(reader.ReadUInt16()); } } if ((flag & 0x00000020) != 0) { var cnt = reader.ReadInt32(); cUnk.Clear(); for (int i = 0; i < cnt; ++i) { cUnk.Add(reader.ReadUInt16()); } } if ((flag & 0x00000040) != 0) { var cnt = reader.ReadInt32(); cSounds.Clear(); for (int i = 0; i < cnt; ++i) { cSounds.Add(reader.ReadUInt16()); } } } scriptCommandsAmount = (int)reader.ReadUInt32(); if (scriptCommandsAmount != 0) { scriptCommand = new Script.MainScript.ScriptCommand(reader, scriptGameVersion); var command = scriptCommand; do { scriptCommands.Add(command); command = command.nextCommand; } while (command != null); } else { scriptCommand = null; } this.size = size; }
public override void Load(BinaryReader reader, int size) { if (ParentType == SectionType.ScriptX) { scriptGameVersion = 1; } else if (ParentType == SectionType.ScriptDemo) { scriptGameVersion = 2; } else { scriptGameVersion = 0; } var sk = reader.BaseStream.Position; UnkBitfield = reader.ReadUInt32(); for (int i = 0; i < 8; ++i) { ScriptSlots[i] = reader.ReadByte(); } //Class1 = reader.ReadUInt32(); //Class2 = reader.ReadUInt32(); //Class3 = reader.ReadUInt32(); var len = reader.ReadInt32(); Name = new string(reader.ReadChars(len)); // Read UInt32 script slots var cnt = reader.ReadInt32(); UI32.Clear(); for (int i = 0; i < cnt; ++i) { UI32.Add(reader.ReadUInt32()); } // Read OGI script slots cnt = reader.ReadInt32(); OGIs.Clear(); for (int i = 0; i < cnt; ++i) { OGIs.Add(reader.ReadUInt16()); } // Read Animation script slots cnt = reader.ReadInt32(); Anims.Clear(); for (int i = 0; i < cnt; ++i) { Anims.Add(reader.ReadUInt16()); } // Read Script script slots cnt = reader.ReadInt32(); Scripts.Clear(); for (int i = 0; i < cnt; ++i) { Scripts.Add(reader.ReadUInt16()); } // Read Object script slots cnt = reader.ReadInt32(); Objects.Clear(); for (int i = 0; i < cnt; ++i) { Objects.Add(reader.ReadUInt16()); } // Read Sound script slots cnt = reader.ReadInt32(); Sounds.Clear(); for (int i = 0; i < cnt; ++i) { Sounds.Add(reader.ReadUInt16()); } // Read instance properties if ((UnkBitfield & 0x20000000) != 0x0) { PHeader = reader.ReadUInt32(); PUI32 = reader.ReadUInt32(); cnt = reader.ReadInt32(); instFlagsList.Clear(); for (int i = 0; i < cnt; ++i) { instFlagsList.Add(reader.ReadUInt32()); } cnt = reader.ReadInt32(); instFloatsList.Clear(); for (int i = 0; i < cnt; ++i) { instFloatsList.Add(reader.ReadSingle()); } cnt = reader.ReadInt32(); instIntegerList.Clear(); for (int i = 0; i < cnt; ++i) { instIntegerList.Add(reader.ReadUInt32()); } } else { PHeader = 0; PUI32 = 0; instFlagsList.Clear(); instFloatsList.Clear(); instIntegerList.Clear(); } // Read IDs needed for instance creation if ((UnkBitfield & 0x40000000) != 0x0) { flag = reader.ReadUInt32(); if ((flag & 0x00000001) != 0) { cnt = reader.ReadInt32(); cObjects.Clear(); for (int i = 0; i < cnt; ++i) { cObjects.Add(reader.ReadUInt16()); } } if ((flag & 0x00000002) != 0) { cnt = reader.ReadInt32(); cOGIs.Clear(); for (int i = 0; i < cnt; ++i) { cOGIs.Add(reader.ReadUInt16()); } } if ((flag & 0x00000004) != 0) { cnt = reader.ReadInt32(); cAnims.Clear(); for (int i = 0; i < cnt; ++i) { cAnims.Add(reader.ReadUInt16()); } } if ((flag & 0x00000008) != 0) { cnt = reader.ReadInt32(); cCM.Clear(); for (int i = 0; i < cnt; ++i) { cCM.Add(reader.ReadUInt16()); } } if ((flag & 0x00000010) != 0) { cnt = reader.ReadInt32(); cScripts.Clear(); for (int i = 0; i < cnt; ++i) { cScripts.Add(reader.ReadUInt16()); } } if ((flag & 0x00000020) != 0) { cnt = reader.ReadInt32(); cUnk.Clear(); for (int i = 0; i < cnt; ++i) { cUnk.Add(reader.ReadUInt16()); } } if ((flag & 0x00000040) != 0) { cnt = reader.ReadInt32(); cSounds.Clear(); for (int i = 0; i < cnt; ++i) { cSounds.Add(reader.ReadUInt16()); } } } scriptCommandsAmount = (int)reader.ReadUInt32(); if (scriptCommandsAmount != 0) { scriptCommand = new Script.MainScript.ScriptCommand(reader, scriptGameVersion); var command = scriptCommand; do { scriptCommands.Add(command); command = command.nextCommand; } while (command != null); } else { scriptCommand = null; } this.size = size; }
//--- impl // Accept input for the current level // may result in level up or game over void AcceptEvent(InputEvent input, int?intparam) { VerboseLog("Accept input of {0} {1}", input, intparam); Sounds.Clear(); switch (input) { case InputEvent.Level: _messages.Clear(); LoadLevel(intparam ?? 0); break; case InputEvent.Reset: VerboseLog($"Loading level {_levelindex}"); _messages.Clear(); LoadLevel(_levelindex); break; case InputEvent.Restart: VerboseLog("Restarting"); _messages.Clear(); Restart(_states.Last()); _modelstate = ModelState.Level; CheckTrigger(SoundTrigger.Restart); break; case InputEvent.Undo: if (_states.Count > 1) { VerboseLog("Undoing"); _messages.Clear(); _states.Remove(_states.Last()); CheckTrigger(SoundTrigger.Undo); } _modelstate = ModelState.Level; break; default: // if any queued message, discard input if (_messages.Any()) { CheckTrigger(SoundTrigger.Closemessage); VerboseLog("Closing message (of {0})", _messages.Count); _messages.RemoveAt(0); // if more messages or still in level swallow input and wait for more // otherwise tick in message level, tick to next if (_messages.Any()) { CheckTrigger(SoundTrigger.Showmessage); } else if (InMessage) { SetNextState(InputEvent.Tick, intparam); } } else { SetNextState(input, intparam); } break; } VerboseLogFlush(); }