public void Clear(bool RaiseChangedEvent) { if (RaiseChangedEvent) { Guilds.Clear(); YouDeclaredAllyList.Clear(); YouDeclaredEnemyList.Clear(); DeclaredYouAllyList.Clear(); DeclaredYouEnemyList.Clear(); } else { guilds.Clear(); youDeclaredAllyList.Clear(); youDeclaredEnemyList.Clear(); declaredYouAllyList.Clear(); declaredYouEnemyList.Clear(); } }
public void UpdateFromModel(DiplomacyInfo Model, bool RaiseChangedEvent) { if (RaiseChangedEvent) { // update states first to look them up in guilds YouDeclaredAllyList.Clear(); foreach (ObjectID obj in Model.YouDeclaredAllyList) { YouDeclaredAllyList.Add(obj); } YouDeclaredEnemyList.Clear(); foreach (ObjectID obj in Model.YouDeclaredEnemyList) { YouDeclaredEnemyList.Add(obj); } DeclaredYouAllyList.Clear(); foreach (ObjectID obj in Model.DeclaredYouAllyList) { DeclaredYouAllyList.Add(obj); } DeclaredYouEnemyList.Clear(); foreach (ObjectID obj in Model.DeclaredYouEnemyList) { DeclaredYouEnemyList.Add(obj); } // then guilds Guilds.Clear(); foreach (GuildEntry obj in Model.Guilds) { Guilds.Add(obj); } } else { // update states first to look them up in guilds youDeclaredAllyList.Clear(); foreach (ObjectID obj in Model.YouDeclaredAllyList) { youDeclaredAllyList.Add(obj); } youDeclaredEnemyList.Clear(); foreach (ObjectID obj in Model.YouDeclaredEnemyList) { youDeclaredEnemyList.Add(obj); } declaredYouAllyList.Clear(); foreach (ObjectID obj in Model.DeclaredYouAllyList) { declaredYouAllyList.Add(obj); } declaredYouEnemyList.Clear(); foreach (ObjectID obj in Model.DeclaredYouEnemyList) { declaredYouEnemyList.Add(obj); } // then guilds guilds.Clear(); foreach (GuildEntry obj in Model.Guilds) { guilds.Add(obj); } } }