|
-
Dec 4th, 2007, 09:42 PM
#1
Thread Starter
Junior Member
[2005] Help with Class for Game Statistics
I'm trying to learn how to use classes correctly as I have just been using structures so far which isn't clean an efficient (or re-usable)
I am trying to create a class to accumulate the stats of a Volleyball game with.
I created a Game Class which has the team names and date and game number and I am trying to create a points class which will log the stats of each point which I will then export to a database. I can't seem to figure out how to do this correctly though.
I already have the algorithms that I will be using to get the data it is just correctly storing it in a class that has an array of points which has an array of plays which I can't figure out.
Rough structure would be something like:
Game Class
_HomeTeam
_AwayTeam
_Date
End Class
Points Class
inherits Game?
This class would hold an array of data
each point has numerous touches so I need a play array
which would be an array within the point
and each touch or play would hold
_TeamId (this is the team that performed the play)
_PlayType (this would be Serve/Pass/Dig/Set/Spike/Block)
_PlayerNumber
_PlayResult (this would represent if the play was a point for the team or just continued the rally or was a point for the other team such as -1/0/1)
End Class
So as an example:
points(1) would be the first point played in the game and then you would have the rallies that happened during the point so:
with point(1)
play(0).type = serve
play(0).team = 1
play(0).playerno = 5
play(0).result = 0
play(1).type = pass
play(1).team = 2
play(1).playerno = 10
play(1).result = 0
play(2).type = set
play(2).team = 2
play(2).playerno = 3
play(2).result = 0
play(3).type = pass
play(3).team = 2
play(3).playerno = 10
play(3).result = 1 (because it was a kill)
end with
Then the next point would be
with point(2)
play(0).type = serve
play(0).team = 2
play(0).playerno = 4
play(0).result = -1 (in this case the team missed the serve)
end with
Any help with how to do this is greatly appreciated. Please let me know if I need to be more clear about something.
Thanks
Last edited by legacyvbc; Dec 5th, 2007 at 05:16 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|