public void ParseDefinition(byte[] data, int version) { HeroDefinition definition = HeroDefinition.Create(data, version); if (definition != null) { this.definitions[definition.Id] = definition; string key = string.Empty; if (string.IsNullOrEmpty(definition.Name)) { key = definition.Id.ToString(); } else { key = definition.Name; } this.DefinitionsByName[definition.Type][key] = definition; //Extension point if (addNodeAction != null) { this.addNodeAction(definition); } if (definition.Type == HeroDefinition.Types.Node) { this.AddNode(definition as HeroNodeDef); } } }
public void ParseDefinition(byte[] data, int version) { HeroDefinition heroDefinition = HeroDefinition.Create(data, version); if (heroDefinition == null) { return; } this.definitions[heroDefinition.Id] = heroDefinition; this.DefinitionsByName[heroDefinition.Type][heroDefinition.Name] = heroDefinition; if (heroDefinition.Type != HeroDefinition.Types.Node) { return; } this.AddNode(heroDefinition as HeroNodeDef); }