Ejemplo n.º 1
0
    private bool TraversePlayer <T>(ref T Func)
    {
        bool bResult  = false;
        bool bRetCode = false;

        KSearchTactic rTactic = Func as KSearchTactic;

        if (rTactic == null)
        {
            goto Exit0;
        }

        for (int i = 0; i < m_PlayerList.Count; ++i)
        {
            KPlayer pPlayer = m_PlayerList[i];

            bRetCode = rTactic.OperatorSearch(pPlayer);
            if (bRetCode == false)
            {
                goto Exit0;
            }
        }

        bResult = true;
Exit0:
        return(bResult);
    }
Ejemplo n.º 2
0
    public static void AISearchCharacter <T>(T rTactic)
    {
        KScene pScene = null;

        KSearchTactic pCenterObj = rTactic as KSearchTactic;

        if (pCenterObj == null)
        {
            //error
            goto Exit0;
        }

        KSceneObject pSceneObject = (KSceneObject)pCenterObj.m_pSelf;

        if (pSceneObject == null)
        {
            //error
            goto Exit0;
        }


        pScene = pSceneObject.m_pScene;
        if (pScene == null)
        {
            //error
            goto Exit0;
        }

        // 暂时只有npc
        pScene.TraverseRangeNpc(ref rTactic);
        pScene.TraverseRangePlayer(ref rTactic);



Exit0:
        return;
    }