|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Runtime.ConstrainedExecution; |
| 5 | +using System.Runtime.Remoting.Messaging; |
| 6 | +using System.Text; |
| 7 | + |
| 8 | +namespace FSM97Lib |
| 9 | +{ |
| 10 | + public static class PositionRatings |
| 11 | + { |
| 12 | + static byte[][] ratings; |
| 13 | + public static byte[][] Ratings |
| 14 | + { get { return ratings; } } |
| 15 | + static PositionRatings() |
| 16 | + { |
| 17 | + ratings = new byte[(int)PlayerPosition.Count][]; |
| 18 | + var gkRatings = new byte[(int)PlayerAttribute.Count]; |
| 19 | + gkRatings[(int)PlayerAttribute.Speed] = 2; |
| 20 | + gkRatings[(int)PlayerAttribute.Agility] = 25; |
| 21 | + gkRatings[(int)PlayerAttribute.Passing] = 2; |
| 22 | + gkRatings[(int)PlayerAttribute.Control] = 4; |
| 23 | + gkRatings[(int)PlayerAttribute.Coolness] = 7; |
| 24 | + gkRatings[(int)PlayerAttribute.Awareness] = 10; |
| 25 | + gkRatings[(int)PlayerAttribute.Kicking] = 8; |
| 26 | + gkRatings[(int)PlayerAttribute.Throwing] = 6; |
| 27 | + gkRatings[(int)PlayerAttribute.Handling] = 30; |
| 28 | + gkRatings[(int)PlayerAttribute.Consistency] = 6; |
| 29 | + ratings[(int)PlayerPosition.GK] = gkRatings; |
| 30 | + var lrbRatings = new byte[(int)PlayerAttribute.Count]; |
| 31 | + lrbRatings[(int)PlayerAttribute.Speed] = 3; |
| 32 | + lrbRatings[(int)PlayerAttribute.Passing] = 7; |
| 33 | + lrbRatings[(int)PlayerAttribute.Heading] = 8; |
| 34 | + lrbRatings[(int)PlayerAttribute.TackleDetermination] = 10; |
| 35 | + lrbRatings[(int)PlayerAttribute.TackleSkill] = 44; |
| 36 | + lrbRatings[(int)PlayerAttribute.Coolness] = 7; |
| 37 | + lrbRatings[(int)PlayerAttribute.Awareness] = 15; |
| 38 | + lrbRatings[(int)PlayerAttribute.Consistency] = 4; |
| 39 | + lrbRatings[(int)PlayerAttribute.Determination] = 2; |
| 40 | + ratings[(int)PlayerPosition.LB] = lrbRatings; |
| 41 | + ratings[(int)PlayerPosition.RB] = lrbRatings; |
| 42 | + var cdRatings = new byte[(int)PlayerAttribute.Count]; |
| 43 | + cdRatings[(int)PlayerAttribute.Speed] = 3; |
| 44 | + cdRatings[(int)PlayerAttribute.Passing] = 3; |
| 45 | + cdRatings[(int)PlayerAttribute.Heading] = 14; |
| 46 | + cdRatings[(int)PlayerAttribute.TackleDetermination] = 10; |
| 47 | + cdRatings[(int)PlayerAttribute.TackleSkill] = 50; |
| 48 | + cdRatings[(int)PlayerAttribute.Coolness] = 7; |
| 49 | + cdRatings[(int)PlayerAttribute.Awareness] = 8; |
| 50 | + cdRatings[(int)PlayerAttribute.Consistency] = 2; |
| 51 | + cdRatings[(int)PlayerAttribute.Leadership] = 3; |
| 52 | + ratings[(int)PlayerPosition.CD] = cdRatings; |
| 53 | + var lrwbRatings = new byte[(int)PlayerAttribute.Count]; |
| 54 | + lrwbRatings[(int)PlayerAttribute.Speed] = 7; |
| 55 | + lrwbRatings[(int)PlayerAttribute.Agility] = 4; |
| 56 | + lrwbRatings[(int)PlayerAttribute.Acceleration] = 11; |
| 57 | + lrwbRatings[(int)PlayerAttribute.Passing] = 12; |
| 58 | + lrwbRatings[(int)PlayerAttribute.Dribbling] = 26; |
| 59 | + lrwbRatings[(int)PlayerAttribute.TackleDetermination] = 3; |
| 60 | + lrwbRatings[(int)PlayerAttribute.TackleSkill] = 26; |
| 61 | + lrwbRatings[(int)PlayerAttribute.Flair] = 5; |
| 62 | + lrwbRatings[(int)PlayerAttribute.Awareness] = 6; |
| 63 | + ratings[(int)PlayerPosition.LWB] = lrwbRatings; |
| 64 | + ratings[(int)PlayerPosition.RWB] = lrwbRatings; |
| 65 | + var swRatings = new byte[(int)PlayerAttribute.Count]; |
| 66 | + swRatings[(int)PlayerAttribute.Speed] = 12; |
| 67 | + swRatings[(int)PlayerAttribute.Acceleration] = 6; |
| 68 | + swRatings[(int)PlayerAttribute.Passing] = 15; |
| 69 | + swRatings[(int)PlayerAttribute.Heading] = 3; |
| 70 | + swRatings[(int)PlayerAttribute.Dribbling] = 15; |
| 71 | + swRatings[(int)PlayerAttribute.TackleDetermination] = 3; |
| 72 | + swRatings[(int)PlayerAttribute.TackleSkill] = 26; |
| 73 | + swRatings[(int)PlayerAttribute.Awareness] = 20; |
| 74 | + ratings[(int)PlayerPosition.SW] = swRatings; |
| 75 | + var dmRatings = new byte[(int)PlayerAttribute.Count]; |
| 76 | + dmRatings[(int)PlayerAttribute.Speed] = 5; |
| 77 | + dmRatings[(int)PlayerAttribute.Passing] = 40; |
| 78 | + dmRatings[(int)PlayerAttribute.Heading] = 5; |
| 79 | + dmRatings[(int)PlayerAttribute.TackleDetermination] = 3; |
| 80 | + dmRatings[(int)PlayerAttribute.TackleSkill] = 27; |
| 81 | + dmRatings[(int)PlayerAttribute.Awareness] = 20; |
| 82 | + ratings[(int)PlayerPosition.DM] = dmRatings; |
| 83 | + var lrmRatings = new byte[(int)PlayerAttribute.Count]; |
| 84 | + lrmRatings[(int)PlayerAttribute.Speed] = 10; |
| 85 | + lrmRatings[(int)PlayerAttribute.Acceleration] = 5; |
| 86 | + lrmRatings[(int)PlayerAttribute.Shooting] = 3; |
| 87 | + lrmRatings[(int)PlayerAttribute.Passing] = 42; |
| 88 | + lrmRatings[(int)PlayerAttribute.Control] = 5; |
| 89 | + lrmRatings[(int)PlayerAttribute.Dribbling] = 5; |
| 90 | + lrmRatings[(int)PlayerAttribute.TackleSkill] = 20; |
| 91 | + lrmRatings[(int)PlayerAttribute.Awareness] = 5; |
| 92 | + lrmRatings[(int)PlayerAttribute.Flair] = 5; |
| 93 | + ratings[(int)PlayerPosition.LM] = lrmRatings; |
| 94 | + ratings[(int)PlayerPosition.RM] = lrmRatings; |
| 95 | + var amRatings = new byte[(int)PlayerAttribute.Count]; |
| 96 | + amRatings[(int)PlayerAttribute.Speed] = 10; |
| 97 | + amRatings[(int)PlayerAttribute.Acceleration] = 5; |
| 98 | + amRatings[(int)PlayerAttribute.Shooting] = 5; |
| 99 | + amRatings[(int)PlayerAttribute.Passing] = 46; |
| 100 | + amRatings[(int)PlayerAttribute.Control] = 5; |
| 101 | + amRatings[(int)PlayerAttribute.Dribbling] = 5; |
| 102 | + amRatings[(int)PlayerAttribute.TackleSkill] = 14; |
| 103 | + amRatings[(int)PlayerAttribute.Awareness] = 5; |
| 104 | + amRatings[(int)PlayerAttribute.Flair] = 5; |
| 105 | + ratings[(int)PlayerPosition.AM] = amRatings; |
| 106 | + var lrwRatings = new byte[(int)PlayerAttribute.Count]; |
| 107 | + lrwRatings[(int)PlayerAttribute.Speed] = 10; |
| 108 | + lrwRatings[(int)PlayerAttribute.Agility] = 3; |
| 109 | + lrwRatings[(int)PlayerAttribute.Acceleration] = 10; |
| 110 | + lrwRatings[(int)PlayerAttribute.Shooting] = 3; |
| 111 | + lrwRatings[(int)PlayerAttribute.Passing] = 31; |
| 112 | + lrwRatings[(int)PlayerAttribute.Control] = 3; |
| 113 | + lrwRatings[(int)PlayerAttribute.Dribbling] = 27; |
| 114 | + lrwRatings[(int)PlayerAttribute.TackleSkill] = 3; |
| 115 | + lrwRatings[(int)PlayerAttribute.Awareness] = 3; |
| 116 | + lrwRatings[(int)PlayerAttribute.Flair] = 7; |
| 117 | + ratings[(int)PlayerPosition.LW] = lrwRatings; |
| 118 | + ratings[(int)PlayerPosition.RW] = lrwRatings; |
| 119 | + var frRatings = new byte[(int)PlayerAttribute.Count]; |
| 120 | + frRatings[(int)PlayerAttribute.Speed] = 12; |
| 121 | + frRatings[(int)PlayerAttribute.Agility] = 2; |
| 122 | + frRatings[(int)PlayerAttribute.Acceleration] = 8; |
| 123 | + frRatings[(int)PlayerAttribute.Shooting] = 4; |
| 124 | + frRatings[(int)PlayerAttribute.Passing] = 14; |
| 125 | + frRatings[(int)PlayerAttribute.Heading] = 1; |
| 126 | + frRatings[(int)PlayerAttribute.Control] = 10; |
| 127 | + frRatings[(int)PlayerAttribute.Dribbling] = 7; |
| 128 | + frRatings[(int)PlayerAttribute.Awareness] = 12; |
| 129 | + frRatings[(int)PlayerAttribute.Flair] = 10; |
| 130 | + ratings[(int)PlayerPosition.FR] = frRatings; |
| 131 | + var forRatings = new byte[(int)PlayerAttribute.Count]; |
| 132 | + forRatings[(int)PlayerAttribute.Speed] = 10; |
| 133 | + forRatings[(int)PlayerAttribute.Agility] = 2; |
| 134 | + forRatings[(int)PlayerAttribute.Acceleration] = 9; |
| 135 | + forRatings[(int)PlayerAttribute.Shooting] = 36; |
| 136 | + forRatings[(int)PlayerAttribute.Passing] = 4; |
| 137 | + forRatings[(int)PlayerAttribute.Heading] = 10; |
| 138 | + forRatings[(int)PlayerAttribute.Control] = 10; |
| 139 | + forRatings[(int)PlayerAttribute.Dribbling] = 3; |
| 140 | + forRatings[(int)PlayerAttribute.Coolness] = 3; |
| 141 | + forRatings[(int)PlayerAttribute.Awareness] = 4; |
| 142 | + forRatings[(int)PlayerAttribute.Flair] = 9; |
| 143 | + ratings[(int)PlayerPosition.FOR] = forRatings; |
| 144 | + var ssRatings = new byte[(int)PlayerAttribute.Count]; |
| 145 | + ssRatings[(int)PlayerAttribute.Speed] = 6; |
| 146 | + ssRatings[(int)PlayerAttribute.Agility] = 2; |
| 147 | + ssRatings[(int)PlayerAttribute.Acceleration] = 6; |
| 148 | + ssRatings[(int)PlayerAttribute.Shooting] = 29; |
| 149 | + ssRatings[(int)PlayerAttribute.Passing] = 16; |
| 150 | + ssRatings[(int)PlayerAttribute.Heading] = 7; |
| 151 | + ssRatings[(int)PlayerAttribute.Control] = 13; |
| 152 | + ssRatings[(int)PlayerAttribute.Dribbling] = 6; |
| 153 | + ssRatings[(int)PlayerAttribute.Coolness] = 2; |
| 154 | + ssRatings[(int)PlayerAttribute.Awareness] = 3; |
| 155 | + ssRatings[(int)PlayerAttribute.Flair] = 10; |
| 156 | + ratings[(int)PlayerPosition.SS] = ssRatings; |
| 157 | + } |
| 158 | + public static double GetPositionRatingDouble(int playerPosition, byte[] attributes) |
| 159 | + { |
| 160 | + double sum = 0; |
| 161 | + for (int i = 0; i < (int)PlayerAttribute.Count; i++) |
| 162 | + { |
| 163 | + sum += ratings[playerPosition][i] * attributes[i]; |
| 164 | + } |
| 165 | + return sum / 100; |
| 166 | + } |
| 167 | + } |
| 168 | +} |
0 commit comments