private static bool Equals(ICharm x, ICharm y) { if (x.Id != y.Id) { return(false); } if (x.Name != y.Name) { return(false); } if (x.Levels.Length != y.Levels.Length) { return(false); } for (int i = 0; i < x.Levels.Length; i++) { if (Equals(x.Levels[i], y.Levels[i]) == false) { return(false); } } return(true); }
private async Task LoadCharmsData(ILogger logger) { IList <CharmPrimitive> result = await LoadBase <CharmPrimitive>("charms", logger); if (result == null) { return; } var localCharms = new ICharm[result.Count]; for (int i = 0; i < localCharms.Length; i++) { CharmPrimitive currentCharmPrimitive = result[i]; var charmLevels = new DataStructures.CharmLevel[currentCharmPrimitive.Levels.Count]; for (int j = 0; j < charmLevels.Length; j++) { IAbility[] localAbilities = currentCharmPrimitive.Levels[j].Abilitites.Select(x => CreateAbility(x.SkillId, x.Level)).ToArray(); charmLevels[j] = new DataStructures.CharmLevel(i + 1, currentCharmPrimitive.Levels[j], localAbilities); } localCharms[i] = new Charm(i + 1, currentCharmPrimitive.Name, charmLevels); } charms = localCharms; }
private CharmPrimitive ConvertCharm(ICharm charm) { return(new CharmPrimitive { Name = charm.Name, Levels = charm.Levels.Select(ConvertCharmLevel).ToList() }); }
public void UpdateCharm(ICharm charm) { Charm = charm; }
public void UpdateCharm(ICharm charm) { }