コード例 #1
0
            public IReadOnlyList <E_Unit> GetTargetList(E_Unit self, E_MonsterSkill skill, SkillParam skillParm)
            {
                EffectTargetChooserBase targetChooser = m_targetChooserDict[skill.m_AimType];

                targetChooser.Reset(skill.m_TargetCamp, skill.m_TargetNumber, skill.m_DamageParamList);
                targetChooser.GetEffectTargets(self, skillParm, m_targetList);
                return(m_targetList);
            }
コード例 #2
0
            public TargetStage()
            {
                // 实例化ETC的所有子类
                var etcType      = typeof(EffectTargetChooserBase);
                var etcImplTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.GetTypes()).Where(p => !p.IsAbstract && etcType.IsAssignableFrom(p));

                foreach (var type in etcImplTypes)
                {
                    EffectTargetChooserBase etcObj = type.GetConstructor(Type.EmptyTypes).Invoke(null) as EffectTargetChooserBase;
                    m_targetChooserDict.Add(etcObj.m_TargetAimType, etcObj);
                }
            }