static int set_defaultMyTeam(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.StageConfig obj = (Games.Module.Wars.StageConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name defaultMyTeam");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index defaultMyTeam on a nil value");
            }
        }

        obj.defaultMyTeam = (int)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
    static int get_resource(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.StageConfig obj = (Games.Module.Wars.StageConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name resource");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index resource on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.resource);
        return(1);
    }
    static int set_wallDict(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.StageConfig obj = (Games.Module.Wars.StageConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name wallDict");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index wallDict on a nil value");
            }
        }

        obj.wallDict = (Dictionary <int, Games.Module.Wars.StagePositionConfig>)LuaScriptMgr.GetNetObject(L, 3, typeof(Dictionary <int, Games.Module.Wars.StagePositionConfig>));
        return(0);
    }
    static int set_legionGroups(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.StageConfig obj = (Games.Module.Wars.StageConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name legionGroups");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index legionGroups on a nil value");
            }
        }

        obj.legionGroups = (List <Games.Module.Wars.StageLegionGroupConfig>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <Games.Module.Wars.StageLegionGroupConfig>));
        return(0);
    }
    static int set_stars(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.StageConfig obj = (Games.Module.Wars.StageConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name stars");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index stars on a nil value");
            }
        }

        obj.stars = LuaScriptMgr.GetArrayNumber <int>(L, 3);
        return(0);
    }
Beispiel #6
0
        public StageConfig Clone()
        {
            StageConfig item = new StageConfig();

            item.id = id;
            /** 关卡等级 */
            item.level = level;
            /** 名称 */
            item.name = name;
            /** 描述 */
            item.description = description;
            /** 关卡类型 */
            item.type = type;
            /**  */
            item.nextStageId = nextStageId;
            /** 美术资源编号 */
            item.resource = resource;
            /** 胜利条件 */
            item.winId = winId;
            /** Lua */
            item.lua = lua;
            /** 消耗体力 */
            item.costStrength = costStrength;
            /** 限时 */
            item.time = time;
            /** sos */
            item.sos = sos;
            /** 是否显示血条 */
            item.showHP = showHP;
            /** 中立主公等级 */
            item.neutralRoleLevel = neutralRoleLevel;
            /** 星级评价 */
            item.stars = new List <int>(stars).ToArray();
            /** 掉落编号 */
            item.dropId = dropId;


            /** 势力列表 */
            foreach (var legionConfig in legionDict)
            {
                item.legionDict.Add(legionConfig.Key, legionConfig.Value.Clone());
            }


            /** 势力关系 */
            foreach (StageLegionGroupConfig source in legionGroups)
            {
                StageLegionGroupConfig dist = new StageLegionGroupConfig();
                dist.id = source.id;
                foreach (StageLegionConfig legionConfig in source.list)
                {
                    dist.list.Add(item.legionDict[legionConfig.legionId]);
                }

                item.legionGroups.Add(dist);
            }

            /** 建筑列表 */
            foreach (var positionConfig in buildDict)
            {
                item.buildDict.Add(positionConfig.Key, positionConfig.Value.Clone());
            }
            /** 墙列表 */

            foreach (var positionConfig in wallDict)
            {
                item.wallDict.Add(positionConfig.Key, positionConfig.Value.Clone());
            }

            /** 默认自己势力ID */
            item.defaultMyTeam = defaultMyTeam;


            return(item);
        }
Beispiel #7
0
 /*------------stage config--------------*/
 public void AddStageConfig(StageConfig stageConfig)
 {
     stageConfigs_Index.Add(stageConfig.id, stageConfig);
 }