当前位置: 首页>>代码示例>>C#>>正文


C# LevelPermission类代码示例

本文整理汇总了C#中LevelPermission的典型用法代码示例。如果您正苦于以下问题:C# LevelPermission类的具体用法?C# LevelPermission怎么用?C# LevelPermission使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LevelPermission类属于命名空间,在下文中一共展示了LevelPermission类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Group

 // Constructor
 public Group(string name, string color, GroupEnum g, bool chat, LevelPermission permission, Int32 _cuboidLimit)
 {
     blnChat = chat;
     groupLevel = g;
     lvlPermission = permission;
     strColor = color;
     strName = name;
     mCuboidLimit = _cuboidLimit;
 }
开发者ID:TaFinalDestination,项目名称:MCSharp,代码行数:10,代码来源:Group.cs

示例2: Group

 public Group(LevelPermission Perm, int maxB, string fullName, char newColor, string file)
 {
     Permission = Perm;
     maxBlocks = maxB;
     trueName = fullName;
     name = trueName.ToLower();
     color = "&" + newColor;
     fileName = file;
     if (name != "nobody")
         playerList = PlayerList.Load(fileName, this);
     else
         playerList = new PlayerList();
 }
开发者ID:Herocane,项目名称:Evolve,代码行数:13,代码来源:Group.cs

示例3: Group

 /// <summary>
 /// Create a new group object
 /// </summary>
 /// <param name="Perm">The permission of the group</param>
 /// <param name="maxB">The maxblocks this group can cuboid</param>
 /// <param name="maxUn">The max undo this group can do</param>
 /// <param name="fullName">The group full name</param>
 /// <param name="newColor">The color of the group (Not including the &)</param>
 /// <param name="motd">the custom MOTD for the group</param>
 /// <param name="file">The file path where the current players of this group are stored</param>
 public Group(LevelPermission Perm, int maxB, long maxUn, string fullName, char newColor, string motd, string file) {
     Permission = Perm;
     maxBlocks = maxB;
     maxUndo = maxUn;
     trueName = fullName;
     name = trueName.ToLower();
     color = "&" + newColor;
     MOTD = motd;
     fileName = file;
     //playerList = name != "nobody" ? PlayerList.Load(fileName, this) : new PlayerList();
     //if(OnGroupLoaded != null)
     //OnGroupLoaded(this);
     //OnGroupLoadedEvent.Call(this);
 }
开发者ID:ninedrafted,项目名称:MCForge-Vanilla,代码行数:24,代码来源:Group.cs

示例4: LavaSurvival

        // Constructors
        public LavaSurvival()
        {
            maps = new List<string>();
            voted = new List<string>();
            votes = new Dictionary<string, int>();
            announceTimer = new Timer(60000);
            announceTimer.AutoReset = true;
            announceTimer.Elapsed += new ElapsedEventHandler(delegate
            {
                AnnounceTimeLeft(true, false);
            });

            startOnStartup = false;
            sendAfkMain = true;
            voteCount = 2;
            voteTime = 2;
            setupRank = LevelPermission.Operator;
            LoadSettings();
        }
开发者ID:Techjar,项目名称:MCaznowl-Lava,代码行数:20,代码来源:LavaSurvival.cs

示例5: LavaSurvival

        // Constructors
        public LavaSurvival()
        {
            maps = new List<string>();
            voted = new List<string>();
            votes = new Dictionary<string, int>();
            deaths = new Dictionary<string, int>();
            announceTimer = new Timer(60000);
            announceTimer.AutoReset = true;
            announceTimer.Elapsed += delegate
            {
                if (!flooded) AnnounceTimeLeft(true, false);
            };

            startOnStartup = false;
            sendAfkMain = true;
            voteCount = 2;
            voteTime = 2;
            lifeNum = 3;
            setupRank = LevelPermission.Admin;
            controlRank = LevelPermission.Operator;
            LoadSettings();
        }
开发者ID:Cazzar,项目名称:MCForge-MCLawl,代码行数:23,代码来源:LavaSurvival.cs

示例6: fillLowest

        private void fillLowest(ref TextBox txtBox, ref LevelPermission toChange)
        {
            if (txtBox.Text != "")
            {
                txtBox.Text = txtBox.Text.Trim().ToLower();
                int foundPerm = -100;
                try
                {
                    foundPerm = int.Parse(txtBox.Text);
                }
                catch
                {
                    Group foundGroup = Group.Find(txtBox.Text);
                    if (foundGroup != null) foundPerm = (int)foundGroup.Permission;
                    else { Server.s.Log("Could not find " + txtBox.Text); }
                }

                txtBox.Text = "";
                if (foundPerm < -99) txtBox.Text = (int)toChange + "";
                else txtBox.Text = foundPerm + "";

                toChange = (LevelPermission)Convert.ToInt16(txtBox.Text);
            }
        }
开发者ID:EricKilla,项目名称:MCForge-Vanilla,代码行数:24,代码来源:PropertyWindow.cs

示例7: AddCommands

        public static void AddCommands(out CommandList commands, LevelPermission perm)
        {
            commands = new CommandList();

            foreach (rankAllowance aV in allowedCommands)
                if ((aV.lowestRank <= perm && !aV.disallow.Contains(perm)) || aV.allow.Contains(perm)) commands.Add(Command.all.Find(aV.commandName));
        }
开发者ID:Herocane,项目名称:Evolve,代码行数:7,代码来源:Group.cs

示例8: findPerm

 public static Group findPerm(LevelPermission Perm)
 {
     foreach (Group grp in GroupList)
     {
         if (grp.Permission == Perm) return grp;
     }
     return null;
 }
开发者ID:Herocane,项目名称:Evolve,代码行数:8,代码来源:Group.cs

示例9: findPerm

 /// <summary>
 /// Find the group with the permission /Perm/
 /// </summary>
 /// <param name="Perm">The level permission to search for</param>
 /// <returns>The group object with that level permission</returns>
 public static Group findPerm(LevelPermission Perm)
 {
     return GroupList.FirstOrDefault(grp => grp.Permission == Perm);
 }
开发者ID:Cazzar,项目名称:MCForge-MCLawl,代码行数:9,代码来源:Group.cs

示例10: canPlace

        public static bool canPlace(LevelPermission givenPerm, byte givenBlock)
        {
            foreach (Blocks b in BlockList)
            {
                if (givenBlock == b.type)
                {
                    if ((b.lowestRank <= givenPerm && !b.disallow.Contains(givenPerm)) || b.allow.Contains(givenPerm)) return true;
                    return false;
                }
            }

            return false;
        }
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:13,代码来源:Block.cs

示例11: PermissionToName

 public static string PermissionToName(LevelPermission perm)
 {
     Group foundGroup = Group.findPerm(perm);
     if (foundGroup != null)
         return foundGroup.name;
     else
         return ((int)perm).ToString();
 }
开发者ID:727021,项目名称:OLD-MCSong,代码行数:8,代码来源:Level.cs

示例12: PermissionToName

        public static string PermissionToName(LevelPermission perm)
        {
            string strPermission = "Null";
            switch (perm)
            {
                case LevelPermission.Guest:
                    strPermission = "Guest";
                    break;
                case LevelPermission.Builder:
                    strPermission = "Builder";
                    break;
                case LevelPermission.AdvBuilder:
                    strPermission = "AdvBuilder";
                    break;
                case LevelPermission.Moderator:
                    strPermission = "Moderator";
                    break;
                case LevelPermission.Operator:
                    strPermission = "Operator";
                    break;
                case LevelPermission.Admin:
                    strPermission = "Admin";
                    break;
            }

            return strPermission;
        }
开发者ID:Voziv,项目名称:MCSharp,代码行数:27,代码来源:Map.cs

示例13: GetName

 static string GetName(LevelPermission perm) {
     string permName = Level.PermissionToName(perm).ToLower();
     return Group.Exists(permName) ? permName :
         Level.PermissionToName(LevelPermission.Nobody);
 }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:5,代码来源:LvlProperties.cs

示例14: LoadSettings

        public void LoadSettings()
        {
            if (!File.Exists("properties/lavasurvival.properties"))
            {
                SaveSettings();
                return;
            }

            foreach (string line in File.ReadAllLines("properties/lavasurvival.properties"))
            {
                try
                {
                    if (line[0] != '#')
                    {
                        string value = line.Substring(line.IndexOf(" = ") + 3);
                        switch (line.Substring(0, line.IndexOf(" = ")).ToLower())
                        {
                            case "start-on-startup":
                                startOnStartup = bool.Parse(value);
                                break;
                            case "send-afk-to-main":
                                sendAfkMain = bool.Parse(value);
                                break;
                            case "vote-count":
                                voteCount = (byte)MathHelper.Clamp(decimal.Parse(value), 2, 10);
                                break;
                            case "vote-time":
                                voteTime = double.Parse(value);
                                break;
                            case "lives":
                                lifeNum = int.Parse(value);
                                break;
                            case "setup-rank":
                                if (Group.Find(value.ToLower()) != null)
                                    setupRank = Group.Find(value.ToLower()).Permission;
                                break;
                            case "control-rank":
                                if (Group.Find(value.ToLower()) != null)
                                    controlRank = Group.Find(value.ToLower()).Permission;
                                break;
                            case "maps":
                                foreach (string mapname in value.Split(','))
                                    if(!String.IsNullOrEmpty(mapname) && !maps.Contains(mapname)) maps.Add(mapname);
                                break;
                        }
                    }
                }
                catch (Exception e) { Server.ErrorLog(e); }
            }
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:50,代码来源:LavaSurvival.cs

示例15: LoadSettings

        public void LoadSettings()
        {
            if (!File.Exists("properties/lavasurvival.properties"))
            {
                SaveSettings();
                return;
            }

            foreach (string line in File.ReadAllLines("properties/lavasurvival.properties"))
            {
                try
                {
                    if (line[0] != '#')
                    {
                        string value = line.Substring(line.IndexOf(" = ") + 3);
                        switch (line.Substring(0, line.IndexOf(" = ")).ToLower())
                        {
                            case "start-on-startup":
                                startOnStartup = bool.Parse(value);
                                break;
                            case "send-afk-to-main":
                                sendAfkMain = bool.Parse(value);
                                break;
                            case "vote-count":
                                voteCount = (byte)NumberClamp(decimal.Parse(value), 2, 10);
                                break;
                            case "vote-time":
                                voteTime = double.Parse(value);
                                break;
                            case "setup-rank":
                                setupRank = Level.PermissionFromName(value.ToLower());
                                break;
                            case "maps":
                                foreach (string mapname in value.Split(','))
                                    if(!maps.Contains(mapname)) maps.Add(mapname);
                                break;
                        }
                    }
                }
                catch (Exception e) { Server.ErrorLog(e); }
            }
        }
开发者ID:Techjar,项目名称:MCaznowl-Lava,代码行数:42,代码来源:LavaSurvival.cs


注:本文中的LevelPermission类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。