public void Deserialize(SpellCategoryEnum category)
        {
            var obj = FromCategory(category);

            this.Category = obj.Category;
            this.Effects  = obj.Effects;
        }
示例#2
0
        public short GetTargetedCell(BrainFighter fighter, SpellCategoryEnum category, SpellLevelRecord level)
        {
            if (fighter.Brain.HasBehavior)
            {
                var cellId = fighter.Brain.GetBehavior <Behavior>().GetTargetCellForSpell(level.SpellId);

                if (cellId != null)
                {
                    return(cellId.Value);
                }
            }
            var handler = Handlers.FirstOrDefault(x => x.Key.SpellCategory == category);

            if (handler.Value != null)
            {
                return((short)handler.Value.Invoke(this, new object[] { fighter, level }));
            }
            else
            {
                return(fighter.CellId);
            }
        }
 public List <SpellRecord> GetSpellsByCategory(SpellCategoryEnum category)
 {
     return(Template.Spells.ConvertAll <SpellRecord>(x => SpellRecord.GetSpell(x)).FindAll(x => x.Category == category));
 }
 public static string GetFileName(SpellCategoryEnum category)
 {
     return(FILES_DIRECTORY + category + ".xml");
 }
 public static SpellCategory FromCategory(SpellCategoryEnum category)
 {
     return((SpellCategory)Serializer.Deserialize(File.ReadAllText(GetFileName(category))));
 }
 public SpellCategory(SpellCategoryEnum category, EffectsEnum[] effects)
 {
     this.Category = category;
     this.Effects  = effects;
 }
示例#7
0
 public TargetSelector(SpellCategoryEnum category)
 {
     this.SpellCategory = category;
 }
示例#8
0
 public List<SpellRecord> GetSpellsByCategory(SpellCategoryEnum category)
 {
     return Template.Spells.ConvertAll<SpellRecord>(x => SpellRecord.GetSpell(x)).FindAll(x => x.Category == category);
 }