I'm creating a small and simple app to use with my poker league. I've created a small DB that I simply enter the player name, who took them out, and what place they went out in. All of that works just fine. What I need to do is implement the point system that I use so that the points column in the database is automatically populated with the players points based on when they went out of the tournament. I don't have my code with me on this computer, so I'll explain the process as best I can here.
Heres the Table columns:
[ID], [Player], [Hitman], [Rank], [Points]
As I said, the app is quite simple. I enter the player name that went out (player), the player that took them out (hitman), and what place they went out in (rank). Touching "Add" inserts this information into the DB (the ID column auto increments). This populates the DB to ...
1...player...hitman...18...null
2...player...hitman...17...null
-etc-
I need to add in my points formula so that the [Points] column gets populated. The formula is fairly simple...(50-(r3)+(2h)+(t-r)).
* r =rank
* h=hits
* t=total players
For example, there are 18 players and a player goes out in 15th place after taking out two other people. The formula would read the following way:
* (50-(153)+(22)+(18-15)
* or (50-45+4+3)
for a total of 12 points (yes, some players do end up in negative points).
How do I write my code to populate the points columns after entering in the data as described above?
I'm using Eclipse v4.2.1 with a Target SDK of 19 and running the app on a galaxy s5.
Thank you for the help!
hendo