protected void RoleGeneratorAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            RoleGenerator roleGenerator = new RoleGenerator(roleType);
            IEnumerable <IPermissionPolicyRole> roleList = e.SelectedObjects.OfType <IPermissionPolicyRole>();
            string updaterCode = roleGenerator.GetUpdaterCode(roleList);

            SaveFile(updaterCode);
        }
コード例 #2
0
ファイル: GameControl.cs プロジェクト: shixuyue/AvalonPoor
        public string InitNewGame(int NumberOfPlayers)
        {
            Guid gameId = Guid.NewGuid();

            Games.gameIds.Add(gameId);
            Games.games.Add(new RuntimeGame(RoleGenerator.InitGame(NumberOfPlayers), gameId));
            return($"The new game is started, and its Id is {gameId}");
        }
コード例 #3
0
        public override void OnAttachToEntity(SceneEntity ety)
        {
            BaseInit(ety);

            generator = RoleGenerator.Create();

            // 注册事件响应函数
            Regist(ControllerCommand.EQUIP_CHANGE, OnEquipChange);
        }
コード例 #4
0
 private TestInfo GetDefaultTestInfo()
 {
     return(new TestInfo
     {
         ExitedUsers = UserGenerator.GetFakeUsers(2),
         NewUser = DtoUserGenerator.GetUserWithRole(Roles.Admin),
         Roles = RoleGenerator.GetFakeRole(1),
         IsPasswordValid = true,
         IsEmailConfirmed = true
     });
 }
コード例 #5
0
    void Preview()
    {
        Debug.Log(Application.isPlaying + "    " + EditorApplication.isPlaying);
        if (!EditorApplication.isPlaying)
        {
            Debug.LogError("请先运行游戏!");
            return;
        }

        GameObject rootGo = GameObject.Find("root");

        if (!rootGo)
        {
            Debug.LogError("缺少骨架!!把骨架信息拖到Hierarchy中");
            return;
        }

        //添加管理器
        RoleGenerateManager manager = rootGo.GetComponent <RoleGenerateManager>();

        if (!manager)
        {
            rootGo.AddComponent <RoleGenerateManager>();
        }

        //添加生成组件
        RoleGenerator generator = rootGo.GetComponent <RoleGenerator>();

        if (generator)
        {
            DestroyImmediate(generator);
        }
        generator = rootGo.AddComponent <RoleGenerator>();

        //----------解析各个部件的ID
        int headID           = ParserID(partDic["头部"][0]); //头部ID
        int hairDecorationID = ParserID(partDic["头部"][1]); //发饰
        int faceID           = ParserID(partDic["表情"][0]); //表情
        int clothID          = ParserID(partDic["上衣"][0]); //上衣
        int weaponID         = ParserID(partDic["上衣"][1]); //武器
        int bagID            = ParserID(partDic["背饰"][0]); //背饰
        int pantsID          = ParserID(partDic["下衣"][0]); //下衣
        int stockingsID      = ParserID(partDic["下衣"][1]); //丝袜
        int shoesID          = ParserID(partDic["下衣"][2]); //鞋子
        int tailID           = ParserID(partDic["尾巴"][0]); //尾巴

        generator.InitPartResID(headID, hairDecorationID, faceID, 0, clothID, weaponID, bagID, pantsID, stockingsID, shoesID, tailID);

        generator.SetAnimation("IDLE");
    }
コード例 #6
0
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            RoleGenerator o = new RoleGenerator();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #7
0
    public static int GetBornChannelIdFromUserId_s(IntPtr l)
    {
        int result;

        try
        {
            string userId;
            LuaObject.checkType(l, 1, out userId);
            int bornChannelIdFromUserId = RoleGenerator.GetBornChannelIdFromUserId(userId);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, bornChannelIdFromUserId);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #8
0
 void LoadRoleBaseData()
 {
     EventDispatcher.GameWorld.Regist(ControllerCommand.ROLE_DATA_BASE_LOADED, OnLoadBaseComplete);
     RoleGenerator.LoadRoleBaseData();
 }