Пример #1
0
 private ICharmTemplate getNativeCharmTemplate(ITemplateRegistry registry) {
   IBasicCharacterData basicCharacterContext = context.getBasicCharacterContext();
   ITemplateType templateType = basicCharacterContext.getTemplateType();
   ICharacterTemplate template = registry.getTemplate(templateType);
   IMagicTemplate magicTemplate = template.getMagicTemplate();
   return magicTemplate.getCharmTemplate();
 }
Пример #2
0
 private ICharmTemplate getCharmTemplate(ITemplateRegistry registry, ICharacterType type) {
   ICharacterTemplate defaultTemplate = registry.getDefaultTemplate(type);
   if (defaultTemplate == null) {
     return null;
   }
   return defaultTemplate.getMagicTemplate().getCharmTemplate();
 }
Пример #3
0
 private ICharmTemplate getNativeCharmTemplate(ITemplateRegistry registry) {
   IBasicCharacterData basicCharacterContext = context.getBasicCharacterContext();
   ITemplateType templateType = basicCharacterContext.getTemplateType();
   IExaltedEdition edition = basicCharacterContext.getRuleSet().getEdition();
   ICharacterTemplate template = registry.getTemplate(templateType, edition);
   IMagicTemplate magicTemplate = template.getMagicTemplate();
   return magicTemplate.getCharmTemplate();
 }
Пример #4
0
 private ICharmTemplate getCharmTemplate(ITemplateRegistry registry, ICharacterType type) {
   ICharacterTemplate defaultTemplate =
       registry.getDefaultTemplate(type, context.getBasicCharacterContext().getEdition());
   if (defaultTemplate == null || defaultTemplate instanceof IUnsupportedTemplate) {
     return null;
   }
   return defaultTemplate.getMagicTemplate().getCharmTemplate();
 }
Пример #5
0
 public ITemplateTypeAggregation[] aggregateTemplates(ICharacterType type) {
   ICharacterExternalsTemplate[] templates =
       characterTemplateRegistry.getAllSupportedTemplates(type);
   Map<ITemplateType, TemplateTypeAggregation> aggregations =
       new LinkedHashMap<ITemplateType, TemplateTypeAggregation>();
   for (ICharacterExternalsTemplate template : templates) {
     TemplateTypeAggregation aggregation = aggregations.get(template.getTemplateType());
     if (aggregation == null) {
       aggregation =
           new TemplateTypeAggregation(
               template.getTemplateType(), template.getPresentationProperties());
       aggregations.put(template.getTemplateType(), aggregation);
     }
     aggregation.addSupportedEdition(template.getEdition());
   }
   Collection<TemplateTypeAggregation> values = aggregations.values();
   return values.toArray(new ITemplateTypeAggregation[values.size()]);
 }