Пример #1
0
        public string GenerateActorName(int actorNumber)
        {
            Zone zone      = World.Instance.Zones.Find(x => x.Id == Position.ZoneId);
            uint zoneId    = zone.Id;
            uint privLevel = 0;

            //get actor zone name
            string zoneName = zone.MapName
                              .Replace("Field", "Fld")
                              .Replace("Dungeon", "Dgn")
                              .Replace("Town", "Twn")
                              .Replace("Battle", "Btl")
                              .Replace("Test", "Tes")
                              .Replace("Event", "Evt")
                              .Replace("Ship", "Shp")
                              .Replace("Office", "Ofc");

            //if (zone.ZoneType == ZoneType.Inn)
            //{
            //    zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P";
            //    //privLevel = ((PrivateArea)zone).GetPrivateAreaType();
            //}

            zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1);

            //Format Class Name
            string className = ClassName.Replace("Populace", "ppl")
                               .Replace("Monster", "Mon")
                               .Replace("Crowd", "Crd")
                               .Replace("MapObj", "Map")
                               .Replace("Object", "Obj")
                               .Replace("Retainer", "Rtn")
                               .Replace("Standard", "Std");

            className = Char.ToLowerInvariant(className[0]) + className.Substring(1);

            if (className.Length > 6 && (className.Length + (zoneName.Length + 4)) > 25)
            {
                try{ className = className.Substring(0, 21 - zoneName.Length); }
                catch (ArgumentOutOfRangeException e) { /*Log.Instance.Error(e.Message);*/ }
            }

            return(string.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, ToStringBase63(actorNumber), zoneId, privLevel));
        }
Пример #2
0
        public FullType(string type)
        {
            FullValue = type;

            var parts = type.Split(".");

            Namespace = string.Join('.', parts.Take(parts.Length - 1));

            var className        = parts.Last();
            var GenericPartMatch = Regex.Match(className, @"<([\w\.\s,]*)>");

            ClassName = className;

            if (GenericPartMatch.Success)
            {
                ClassName = ClassName.Replace(GenericPartMatch.Value, "");

                GenericArguments = Regex
                                   .Split(GenericPartMatch.Groups[1].Value, @",\s?")
                                   .Select(a => new FullType(a));
            }
        }
Пример #3
0
 /// <summary>Generates the name of the controller based on the provided settings.</summary>
 /// <param name="controllerName">Name of the controller.</param>
 /// <returns>The controller name.</returns>
 public string GenerateControllerName(string controllerName)
 {
     return(ClassName.Replace("{controller}", ConversionUtilities.ConvertToUpperCamelCase(controllerName, false)));
 }