コード例 #1
0
        private IEnumerable <SkillObj> GetTargets(SkillObj skillObj, double width, double height)
        {
            Vector3_Hzy     tarVec;
            Vector3_Hzy     srcVec       = skillObj.GetPos();
            var             tList        = skillObj.GetTarListNearby().Where(t => !t.IsDead());
            List <SkillObj> tarList      = new List <SkillObj>();
            double          srcDirRadian = skillObj.GetDirRadian();

            foreach (var tar in tList)
            {
                tarVec = tar.GetPos();
                if (BattleHelper.IsInRect_2D(srcVec, srcDirRadian, tarVec, width, height, skillObj))
                {
                    tarList.Add(tar);
                }
            }
            return(tarList);
        }
コード例 #2
0
        private IEnumerable <SkillObj> GetTargets(SkillObj skillObj, double range)
        {
            Vector3_Hzy     tarVec;
            Vector3_Hzy     srcVec       = skillObj.GetPos();
            var             tList        = skillObj.GetTarListNearby().Where(t => !t.IsDead());
            List <SkillObj> tarList      = new List <SkillObj>();
            double          srcDirRadian = skillObj.GetDirRadian();

            foreach (var tar in tList)
            {
                tarVec = tar.GetPos();
                double distance = BattleHelper.Distance_2D(tarVec, srcVec);
                if (distance <= range)
                {
                    tarList.Add(tar);
                }
            }
            return(tarList);
        }