V
Vayse
Hi
This is a project I'm doing in my own time, and I'm wondering what the best
method is.
This app is to calculate training on players in an online football game.
Each player has several skills, but for simplicity, lets just say 3 skills -
Scoring, Midfield, Defending. Each week, one skill is trained.
So if Scoring is trained, all Players increase their Scoring skill by a
number. For the example, lets assume the number is one
If TraningType = Scoring, then PlayerTraining.Scoring += 1
I have 3 tables - Players, PlayerTraining, Training.
PLAYERS
PlayerID
PlayerName
Age
PLAYER_TRAINING
PT_WeekID
PT_PlayerID
Scoring
Midfield
Defending
TRAINING
WeekID
TrainingType
So, I was going to write a function to calculate training for a range of
weeks. Something like this, where dtPlayerTraining and dtFilter are both
datatables.
Fill dtPlayerTraining (lStartWeek , lEndWeek)
For iWeekID = lStartWeek to lEndWeek
Fill dtFilter with all players training for iWeekID
Pass dtFilter to a training object. This object works out how much to
increase the appropiate skill in dtFilter
Merge dtFilter back into dtPlayerTrainig
Next
Update dtPlayerTraining
Is this the most efficient way? Any advice appreciated.
Thanks
Vayse
This is a project I'm doing in my own time, and I'm wondering what the best
method is.
This app is to calculate training on players in an online football game.
Each player has several skills, but for simplicity, lets just say 3 skills -
Scoring, Midfield, Defending. Each week, one skill is trained.
So if Scoring is trained, all Players increase their Scoring skill by a
number. For the example, lets assume the number is one
If TraningType = Scoring, then PlayerTraining.Scoring += 1
I have 3 tables - Players, PlayerTraining, Training.
PLAYERS
PlayerID
PlayerName
Age
PLAYER_TRAINING
PT_WeekID
PT_PlayerID
Scoring
Midfield
Defending
TRAINING
WeekID
TrainingType
So, I was going to write a function to calculate training for a range of
weeks. Something like this, where dtPlayerTraining and dtFilter are both
datatables.
Fill dtPlayerTraining (lStartWeek , lEndWeek)
For iWeekID = lStartWeek to lEndWeek
Fill dtFilter with all players training for iWeekID
Pass dtFilter to a training object. This object works out how much to
increase the appropiate skill in dtFilter
Merge dtFilter back into dtPlayerTrainig
Next
Update dtPlayerTraining
Is this the most efficient way? Any advice appreciated.
Thanks
Vayse