Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: I have another problem :( Pin
Luc Pattyn8-Jan-10 16:50
sitebuilderLuc Pattyn8-Jan-10 16:50 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:05
Raztor08-Jan-10 17:05 
AnswerRe: I have another problem :( Pin
Abhinav S8-Jan-10 16:55
Abhinav S8-Jan-10 16:55 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:04
Raztor08-Jan-10 17:04 
GeneralRe: I have another problem :( Pin
Abhinav S8-Jan-10 17:09
Abhinav S8-Jan-10 17:09 
GeneralRe: I have another problem :( Pin
Luc Pattyn8-Jan-10 17:14
sitebuilderLuc Pattyn8-Jan-10 17:14 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:20
Raztor08-Jan-10 17:20 
GeneralRe: I have another problem :( Pin
DaveyM698-Jan-10 23:20
professionalDaveyM698-Jan-10 23:20 
Raztor0 wrote:
solving it by adding static is a good solution


That depends on the purpose of rollcount.

If it's counting the number of ALL rolls in the game, then static is fine as it's not directly related to an instance of the class. If the class had proper names that would belong to a Dice class. It would be better to have a public static (readonly) property with a private static field. Even in this situation, it may be better to have a Game class and the value would be an instance member of that.

If it's counting the number of throws per player then it would need to be an instance member - of a Player class, this class should raise an event to tell the main form (or any other interested party) that the value has changed.

It's really quite easy to do and worth doing properly. Once you've done it the correct way once, you'll never take the nasty 'static' approach again unless it's the correct solution.

If you want further help you'll need to post some relavent code snippets as so far we are just guessing!

Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: I have another problem :( [modified] Pin
Raztor09-Jan-10 4:12
Raztor09-Jan-10 4:12 
GeneralRe: I have another problem :( Pin
DaveyM699-Jan-10 6:23
professionalDaveyM699-Jan-10 6:23 
GeneralRe: I have another problem :( Pin
Raztor09-Jan-10 9:13
Raztor09-Jan-10 9:13 
AnswerRe: I have another problem :( Pin
ajith-k-rajagopalan8-Jan-10 22:00
ajith-k-rajagopalan8-Jan-10 22:00 
Questionopen an av file Pin
saralabasham8-Jan-10 12:16
saralabasham8-Jan-10 12:16 
AnswerRe: open an av file Pin
Bassam Saoud8-Jan-10 12:34
Bassam Saoud8-Jan-10 12:34 
AnswerRe: open an av file Pin
Ravi Bhavnani8-Jan-10 13:41
professionalRavi Bhavnani8-Jan-10 13:41 
AnswerRe: open an avi file Pin
ajith-k-rajagopalan8-Jan-10 21:52
ajith-k-rajagopalan8-Jan-10 21:52 
QuestionSqlDataReader reading beyond end of data Pin
TheJudeDude8-Jan-10 11:58
TheJudeDude8-Jan-10 11:58 
AnswerRe: SqlDataReader reading beyond end of data Pin
Bassam Saoud8-Jan-10 12:31
Bassam Saoud8-Jan-10 12:31 
AnswerRe: SqlDataReader reading beyond end of data Pin
Jimmanuel8-Jan-10 12:33
Jimmanuel8-Jan-10 12:33 
GeneralRe: SqlDataReader reading beyond end of data Pin
TheJudeDude11-Jan-10 5:16
TheJudeDude11-Jan-10 5:16 
GeneralRe: SqlDataReader reading beyond end of data Pin
Jimmanuel11-Jan-10 6:39
Jimmanuel11-Jan-10 6:39 
GeneralRe: SqlDataReader reading beyond end of data Pin
TheJudeDude11-Jan-10 9:04
TheJudeDude11-Jan-10 9:04 
GeneralRe: SqlDataReader reading beyond end of data Pin
Jimmanuel11-Jan-10 9:49
Jimmanuel11-Jan-10 9:49 
AnswerRe: SqlDataReader reading beyond end of data Pin
Migounette8-Jan-10 12:34
Migounette8-Jan-10 12:34 
AnswerRe: SqlDataReader reading beyond end of data Pin
ajith-k-rajagopalan8-Jan-10 21:56
ajith-k-rajagopalan8-Jan-10 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.