Exemplo n.º 1
0
        // Update character from the passed in data
        public void Update(BaseCharacter newData)
        {
            if (newData == null)
            {
                return;
            }

            // Update all the fields in the Data, except for the Id

            // Base information
            Name            = newData.Name;
            Description     = newData.Description;
            Level           = newData.Level;
            ExperienceTotal = newData.ExperienceTotal;
            ImageURI        = newData.ImageURI;
            Alive           = newData.Alive;
            Type            = newData.Type;

            // Database information
            Guid = newData.Guid;
            Id   = newData.Id;

            // Populate the Attributes
            AttributeString = newData.AttributeString;

            // Set the strings for the items
            Head        = newData.Head;
            Feet        = newData.Feet;
            Necklass    = newData.Necklass;
            RightFinger = newData.RightFinger;
            LeftFinger  = newData.LeftFinger;
            Feet        = newData.Feet;
        }
Exemplo n.º 2
0
        public void SortDirectory(string[] files)
        {
            TypesOrMessages = new List <string>();
            Enums           = new List <string>();
            GameDatas       = new List <string>();

            foreach (string file in files)
            {
                string        str = File.ReadAllText(file);
                ClassTypeEnum t   = GetClassType(str);
                switch (t)
                {
                case ClassTypeEnum.Enum:
                    Enums.Add(file);
                    break;

                case ClassTypeEnum.GameData:
                    GameDatas.Add(file);
                    break;

                case ClassTypeEnum.MessageOrType:
                    TypesOrMessages.Add(file);
                    break;
                }
            }
        }
Exemplo n.º 3
0
        // Makes BaseCharacter using character for constructor
        public BaseCharacter(Character newData)
        {
            // Base information
            Name            = newData.Name;
            Description     = newData.Description;
            Level           = newData.Level;
            ExperienceTotal = newData.ExperienceTotal;
            ImageURI        = newData.ImageURI;
            Alive           = newData.Alive;
            Type            = newData.Type;

            // Database information
            Guid = newData.Guid;
            Id   = newData.Id;

            // Populate the Attributes
            AttributeString = newData.AttributeString;

            // Set the strings for the items
            Head        = newData.Head;
            Feet        = newData.Feet;
            Necklass    = newData.Necklass;
            RightFinger = newData.RightFinger;
            LeftFinger  = newData.LeftFinger;
            Feet        = newData.Feet;
        }
        private BasicStats GetCharStats(ClassTypeEnum classType, int lvl, int angPower = 0, int demPower = 0, int ancPower = 0)
        {
            var charClassesJson = System.IO.File.ReadAllText("./Data/CharacterClassesSeed.json");
            var charClasses     = JsonConvert.DeserializeObject <List <CharacterClass> >(charClassesJson);
            var selectedClass   = charClasses.FirstOrDefault(c => c.Id == (int)classType);

            var classSample = new ClassDefinition {
                Level = lvl, ClassType = classType, ClassDescription = selectedClass.Description, AngelicPower = angPower, DemonicPower = demPower, AncestralPower = ancPower
            };

            var charData = new BasicStats {
                ClassDefinition       = classSample
                , Life                = new Life(classSample, selectedClass)
                , Resource            = new Resource(classSample, selectedClass)
                , Stamina             = new Stamina(classSample, selectedClass)
                , DamagePerHit        = new DamagePerHit(classSample)
                , LifeReturn          = new LifestealHitProc().CalculateProcAmount(classSample)
                , ResourceReturn      = new ResourceReturnHitProc().CalculateProcAmount(classSample)
                , StaminaReturn       = new StaminaReturnHitProc().CalculateProcAmount(classSample)
                , StaminaSunder       = new StaminaSunderHitProc().CalculateProcAmount(classSample)
                , SpellPowerBonus     = new SelfEmpowerHitProc().CalculateProcAmount(classSample)
                , SpellPowerReduction = new DamageReductionHitProc().CalculateProcAmount(classSample)
            };

            return(charData);
        }
 public IEnumerable<T> GetPossibles(ClassTypeEnum type)
 {
     switch(type)
     {
         case ClassTypeEnum.City:
             return //source of Cities;
     }
 }
 public IEnumerable<T> GetError(ClassTypeEnum type)
 {
     switch(type)
     {
         case ClassTypeEnum.City:
             return ConfigTranslationCode.CityNotExist;
     }
 }
Exemplo n.º 7
0
 public InitiatorsHint(string hintString, double minWinLoss, int minAssists, int minFirstKills, GameKnowledgeLevelEnum gameKnowledgeLevel)
 {
     this.HintString         = hintString;
     this.MinWinLoss         = minWinLoss;
     this.MinAssists         = minAssists;
     this.MinFirstKills      = minFirstKills;
     this.GameKnowledgeLevel = gameKnowledgeLevel;
     this.ClassType          = ClassTypeEnum.Initiator;
 }
 public DuelistsHint(string hintString, double minWinLoss, double minKillDeathRatio, int minFirstKills, GameKnowledgeLevelEnum gameKnowledgeLevel)
 {
     this.HintString         = hintString;
     this.MinWinLoss         = minWinLoss;
     this.minKillDeathRatio  = minKillDeathRatio;
     this.minFirstKills      = minFirstKills;
     this.GameKnowledgeLevel = gameKnowledgeLevel;
     this.ClassType          = ClassTypeEnum.Duelist;
 }
Exemplo n.º 9
0
 public SentinelsHint(string hintString, double minWinLoss, int minAssists, int maxDeaths, GameKnowledgeLevelEnum gameKnowledgeLevel)
 {
     this.HintString         = hintString;
     this.MinWinLoss         = minWinLoss;
     this.MinAssists         = minAssists;
     this.MaxDeaths          = maxDeaths;
     this.GameKnowledgeLevel = gameKnowledgeLevel;
     this.ClassType          = ClassTypeEnum.Sentinel;
 }
Exemplo n.º 10
0
 public ControllersHint(string hintString, double minWinLoss, int minAssists, int maxDeaths, int minFirstKills, GameKnowledgeLevelEnum gameKnowledgeLevel)
 {
     this.HintString         = hintString;
     this.MinWinLoss         = minWinLoss;
     this.MinAssists         = minAssists;
     this.MaxDeaths          = maxDeaths;
     this.MinFirstKills      = minFirstKills;
     this.GameKnowledgeLevel = gameKnowledgeLevel;
     this.ClassType          = ClassTypeEnum.Controller;
 }
Exemplo n.º 11
0
 public JsClass(ITypeDefinition csharpTypeDefinition, ClassTypeEnum classType, IEnumerable <string> typeArgumentNames, JsExpression baseClass, IEnumerable <JsExpression> implementedInterfaces) : base(csharpTypeDefinition)
 {
     BaseClass             = baseClass;
     ClassType             = classType;
     TypeArgumentNames     = new List <string>(typeArgumentNames ?? new string[0]);
     ImplementedInterfaces = new List <JsExpression>(implementedInterfaces ?? new JsExpression[0]);
     NamedConstructors     = new List <JsNamedConstructor>();
     InstanceMethods       = new List <JsMethod>();
     StaticMethods         = new List <JsMethod>();
     StaticInitStatements  = new List <JsStatement>();
 }
Exemplo n.º 12
0
 public void SetData()
 {
     WeaponClass  = (ClassTypeEnum)((WeaponInfo >> 32) & 63);
     WeaponId     = WeaponInfo >> 6;
     WeaponDamage = HitInfo >> 20;
     DeathType    = (CharaDeathEnum)(HitInfo & 15);
     KillerId     = (byte)((HitInfo >> 11) & 511);
     HitPart      = (HitInfo >> 4) & 63;
     CharaHitPart = (HitCharaPart2Enum)HitPart;
     Unk          = (HitInfo >> 10) & 1; //0 = User | 1 = Object
 }
Exemplo n.º 13
0
        public static Parents CreateInstance(ClassTypeEnum classTypeEnum)
        {
            switch (classTypeEnum)
            {
            case ClassTypeEnum.Child:
                return(new Child());

            default:
                return(null);
            }
        }
Exemplo n.º 14
0
        //Main character constructor. "Rolls" stats based on class type.
        public Character(string name, ClassTypeEnum classType)
        {
            Attribute       = new AttributeBase();
            Alive           = true;
            Level           = 1;
            ExperienceTotal = 0;
            Name            = name;
            Type            = classType;
            RollStats();

            Head = Feet = Necklass = PrimaryHand = OffHand = RightFinger = LeftFinger = "None";
        }
Exemplo n.º 15
0
 public JsClass(ITypeDefinition csharpTypeDefinition, string name, ClassTypeEnum classType, IEnumerable<string> typeArgumentNames, JsExpression baseClass, IEnumerable<JsExpression> implementedInterfaces)
     : base(csharpTypeDefinition, name)
 {
     BaseClass             = baseClass;
     ClassType             = classType;
     TypeArgumentNames     = new List<string>(typeArgumentNames ?? new string[0]);
     ImplementedInterfaces = new List<JsExpression>(implementedInterfaces ?? new JsExpression[0]);
     NamedConstructors     = new List<JsNamedConstructor>();
     InstanceMethods       = new List<JsMethod>();
     StaticMethods         = new List<JsMethod>();
     StaticInitStatements  = new List<JsStatement>();
 }
Exemplo n.º 16
0
 public void SetData()
 {
     HitType        = (HitTypeEnum)((WeaponInfo >> 17) & 7);
     ObjectType     = (ObjectTypeEnum)(HitInfo & 3);
     WeaponClass    = (ClassTypeEnum)(WeaponInfo & 63);
     WeaponId       = WeaponInfo >> 6;
     WeaponDamage   = HitInfo >> 21;
     WeaponObjectId = (HitInfo >> 2) & 511;
     HitPart        = (HitInfo >> 11) & 63;
     CharaHitPart   = (HitCharaPart2Enum)HitPart;
     Range          = Vector3.DistanceRange(FirePos, HitPos);
 }
Exemplo n.º 17
0
 public float Range; //Alcance, HitDistance
 public void SetData()
 {
     HitType        = (HitTypeEnum)((HitInfo >> 17) & 7);
     WeaponClass    = (ClassTypeEnum)(WeaponInfo & 63);
     ObjectType     = (ObjectTypeEnum)(HitInfo & 3);
     WeaponId       = WeaponInfo >> 6;
     WeaponDamage   = HitInfo >> 21;
     WeaponObjectId = (HitInfo >> 2) & 511;
     HitPart        = (HitInfo >> 11) & 63;
     CharaHitPart   = (HitCharaPart2Enum)HitPart;
     DeathType      = HitPart == 29 ? CharaDeathEnum.HEADSHOT : CharaDeathEnum.DEFAULT; //(CharaDeathEnum)(HitInfo & 15)
     Range          = Vector3.DistanceRange(StartBullet, EndBullet);
 }
Exemplo n.º 18
0
 public void ResetBattleInfos()
 {
     TRexImmortal   = false;
     isDead         = true;
     weaponClass    = ClassTypeEnum.Unknown;
     lastDie        = new DateTime();
     C4First        = new DateTime();
     C4FTime        = 0;
     position       = new Half3();
     life           = 100;
     maxLife        = 100;
     plantDuration  = Settings.PlantDuration;
     defuseDuration = Settings.DefuseDuration;
 }
Exemplo n.º 19
0
        public ResponseOutput GetProductsByCatelog(ClassTypeEnum classType)
        {
            var productDtos = new List <ProductDto>();

            try
            {
                _logger.LogInformation("进入GetProductsByCatelog方法");
                var products = _productService.GetProductsByClassType(classType);
                foreach (var product in products)
                {
                    //图片详情
                    var productDetails = _productDetailService.GetDetailsByProductId(product.Id);
                    List <ProductDetailOutputDto> detailDtos = new List <ProductDetailOutputDto>();
                    foreach (var productDetail in productDetails)
                    {
                        detailDtos.Add(new ProductDetailOutputDto()
                        {
                            PhotoPath = productDetail.PhotoPath.Replace('\\', '/')
                        });
                    }

                    productDtos.Add(new ProductDto
                    {
                        Code          = product.ProductCode,
                        Name          = product.ProductName,
                        Description   = product.Description,
                        ClassType     = (int)product.Type,
                        StockStatus   = (int)product.StockType,
                        ProductStatus = (int)product.ProductStatus,
                        Photos        = detailDtos.Select(item => Path.Combine("http://www.bangbangfuli.cn/", item.PhotoPath.Replace('\\', '/'))).ToList()
                    });
                }

                return(new ResponseOutput(productDtos, "0", string.Empty, HttpContext.TraceIdentifier));
            }
            catch (Exception ex)
            {
                _logger.LogError($"异常为{ex.ToString()}");
                return(new ResponseOutput(null, "-1", ex.Message, HttpContext.TraceIdentifier));
            }
        }
Exemplo n.º 20
0
        public static string ToFriendlyShortString(this ClassTypeEnum me)
        {
            switch (me)
            {
            case ClassTypeEnum.Lecture:
                return("W");

            case ClassTypeEnum.Excercise:
                return("Ć");

            case ClassTypeEnum.Lab:
                return("P");

            case ClassTypeEnum.Repetitory:
                return("R");

            case ClassTypeEnum.Other:
                return("I");

            default:
                return("");
            }
        }
Exemplo n.º 21
0
        public static string ToFriendlyString(this ClassTypeEnum me)
        {
            switch (me)
            {
            case ClassTypeEnum.Lecture:
                return("Wykład");

            case ClassTypeEnum.Excercise:
                return("Ćwiczenia");

            case ClassTypeEnum.Lab:
                return("Pracownia");

            case ClassTypeEnum.Repetitory:
                return("Repetytorium");

            case ClassTypeEnum.Other:
                return("Inne");

            default:
                return("");
            }
        }
Exemplo n.º 22
0
        public IActionResult Get(ClassTypeEnum classType, int level = 1)
        {
            // var totalPower = 3 * lvl;
            // var demPower = 0;// rand.Next(0, totalPower/2 + lvl/4);
            // var angPower = 0;// rand.Next(0, totalPower - demPower - totalPower/2 + lvl/4);
            // var ancPower = 0;// totalPower - demPower - angPower;
            var levelValid = level > 0 && level <= _MAX;

            if (!levelValid)
            {
                return(BadRequest(_LEVEL_INVALID));
            }

            var charData = GetCharStats(classType, level);
            var newChar  = GetCharStats(classType, level + 1);

            if (level == _MAX)
            {
                newChar = charData;
            }

            // if Even return ranged char, if Odd return a melee one
            return(Ok(new { Current = charData, New = newChar, IsMaxxed = level == _MAX }));
        }
Exemplo n.º 23
0
        public ClassTypeEnum GetClassTypeMap(int index)
        {
            ClassTypeEnum ret = ClassTypeEnum.unknown;

            switch (index)
            {
            case 0:
                ret = ClassTypeEnum.yuexiangmeiwei;
                break;

            case 1:
                ret = ClassTypeEnum.jujiahaowu;
                break;

            case 2:
                ret = ClassTypeEnum.pingzhishenghuo;
                break;

            case 3:
                ret = ClassTypeEnum.chufangzhengxuan;
                break;
            }
            return(ret);
        }
Exemplo n.º 24
0
 private static void parseEnrolledClasses(List <List <Group> > enrolledCourseMatch, Course course, ClassTypeEnum type)
 {
     foreach (var courseMatch in enrolledCourseMatch)
     {
         var _class = new _Class();
         _class.ClassType = type;
         _class.Teacher   = new Employee()
         {
             Name = courseMatch[3].ToString().Trim(' '), Url = courseMatch[2].ToString()
         };
         var lessonMatches = Regex.Matches(courseMatch[4].ToString(), @">(.*?)\((.*?)\)", RegexOptions.Multiline);
         foreach (Match lessonMatch in lessonMatches)
         {
             var l = parseToLesson(lessonMatch);
             l.Course = course;
             l.Type   = _class.ClassType;
             _class.Lessons.Add(l);
         }
         _class.TotalPeople      = courseMatch[5].ToString().Trim(' ');
         _class.SignedInPeople   = courseMatch[6].ToString().Trim(' ');
         _class.QueuedPeople     = courseMatch[7].ToString().Trim(' ');
         _class.IsSignedIn       = true;
         _class.ListUrl          = courseMatch[13].ToString().Trim(' ');
         _class.IsEnrollment     = !courseMatch[11].ToString().Contains("disabled");
         _class.ButtonEnrollText = courseMatch[12].ToString().Trim(' ').ToUpper();
         _class.buttonListText   = courseMatch[14].ToString().Trim(' ').ToUpper();
         course.Classes.Add(_class);
     }
 }
Exemplo n.º 25
0
 public static Type GetType(ClassTypeEnum classType)
 {
     return(SerializationMap[classType]);
 }
 public static string ValidateExists(ClassTypeEnum type,int id)
 {
     return Exists(type,id) ? String.Empty : Lookup.GetError(type);
 }
 //using lookup Enum
 public static bool Exists(ClassTypeEnum type, int id)
 {
     return Exists(id,Lookup.GetPossibles(type));
 }
Exemplo n.º 28
0
 public ClassDto(int id, SubjectDto subject, ClassTypeEnum classType)
 {
     Id        = id;
     Subject   = subject;
     ClassType = classType;
 }
Exemplo n.º 29
0
 public List <ProductInformation> GetProductsByClassType(ClassTypeEnum type)
 {
     return(_productRepository.GetProductsByClassType(type));
 }
Exemplo n.º 30
0
 protected MyBaseClass(ClassTypeEnum kind)
 {
     ClassTypeReadonlyField = kind;
 }
Exemplo n.º 31
0
 public List <ProductInformation> GetProductsByClassType(ClassTypeEnum type)
 {
     return(Master.ProductInformations.Where(item => item.Type == type).ToList());
 }