예제 #1
0
    /// <summary>
    /// 兵种结构, 和阵型数据
    /// idx : 编队ID
    /// </summary>
    /// <param name="idx"></param>
    private void addAllFormation(int idx)
    {
        FormationAgent formation = new FormationAgent();

        // 设置对应的数据
        formation.setData(_battle.getFormation()[idx]);

        int[] soildArray;                        // 保存兵种结构

        if (idx == (int)Defaults.ResultNum.Zero) ///第一个战场
        {
            soildArray = (int[])_battle.getOneStruct().Clone();
        }
        else
        {
            soildArray = (int[])_battle.getTwoStruct().Clone();
        }

        /// 获取阵型
        int[] shapeArray = formation.getShapeArray();

        //  这里需要注意下 兵种结构 的个数 和 阵型的个数 是一致的

        for (int i = 0; i < soildArray.Length; i++)
        {
            // 记录当前的 位置
            float[] pos = { formation.getPosXArray()[i], formation.getPosYArray()[i], formation.getPosZArray()[i] };

            // 兵种ID  兵种阵型ID  位置信息
            FormationData mation = new FormationData(soildArray[i], shapeArray[i], pos, false);

            _formationList.Add(mation);
        }
    }
예제 #2
0
    /// <summary>
    /// 将阵容上 6个位置上的英雄ID 传过来 null 表示没有人 占位用的
    /// </summary>
    /// <param name="idArray"></param>
    private MyFormationData()
    {
        // 初始化 自己阵容list
        formationList = new List<FormationData>();

        // 阵型, pos  等信息
        FormationAgent foramtion = new FormationAgent();
        foramtion.setData((int)Defaults.ResultNum.One);  // 目前 1 formation 表中 1 是自己的队伍信息

        // 兵种结构
        _battle = new BattleAgent();
        _battle.setData((int)Defaults.ResultNum.One); // 目前 1 battle 表中 1 是自己的队伍信息

        setData(foramtion, _battle);
    }
예제 #3
0
    /// <summary>
    /// 将阵容上 6个位置上的英雄ID 传过来 null 表示没有人 占位用的
    /// </summary>
    /// <param name="idArray"></param>
    private MyFormationData()
    {
        // 初始化 自己阵容list
        formationList = new List <FormationData>();

        // 阵型, pos  等信息
        FormationAgent foramtion = new FormationAgent();

        foramtion.setData((int)Defaults.ResultNum.One);  // 目前 1 formation 表中 1 是自己的队伍信息

        // 兵种结构
        _battle = new BattleAgent();
        _battle.setData((int)Defaults.ResultNum.One); // 目前 1 battle 表中 1 是自己的队伍信息

        setData(foramtion, _battle);
    }
예제 #4
0
    /// <summary>
    /// 兵种结构, 和阵型数据
    /// idx : 编队ID
    /// </summary>
    /// <param name="idx"></param>
    private void addAllFormation( int idx )
    {
        FormationAgent formation = new FormationAgent();

        // 设置对应的数据
        formation.setData(_battle.getFormation()[idx]);

        int[] soildArray; // 保存兵种结构

        if (idx == (int)Defaults.ResultNum.Zero) ///第一个战场
        {
            soildArray = (int[])_battle.getOneStruct().Clone();
        }
        else
        {
            soildArray = (int[])_battle.getTwoStruct().Clone();
        }

        /// 获取阵型
        int[] shapeArray = formation.getShapeArray();

        //  这里需要注意下 兵种结构 的个数 和 阵型的个数 是一致的

        for (int i = 0; i < soildArray.Length; i++)
        {
            // 记录当前的 位置
            float[] pos = { formation.getPosXArray()[i], formation.getPosYArray()[i], formation.getPosZArray()[i] };

            // 兵种ID  兵种阵型ID  位置信息
            FormationData mation = new FormationData(soildArray[i], shapeArray[i], pos, false);

            _formationList.Add(mation);
        }
    }
예제 #5
0
 // 设置数据
 private void setData(FormationAgent formation, BattleAgent battle)
 {
     setAllData(soldierStruct, formation.getShapeArray(), formation.getPosXArray(), formation.getPosYArray(), formation.getPosZArray());
 }
예제 #6
0
 // 设置数据
 private void setData(FormationAgent formation, BattleAgent battle)
 {
     setAllData(soldierStruct, formation.getShapeArray(), formation.getPosXArray(), formation.getPosYArray(), formation.getPosZArray());
 }