Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: What is better way to organise code of big project Pin
Member 1115157120-Oct-14 6:35
Member 1115157120-Oct-14 6:35 
GeneralTo Deeksha Shenoy Pin
hevesir20-Oct-14 1:10
hevesir20-Oct-14 1:10 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 2:42
mveOriginalGriff20-Oct-14 2:42 
GeneralRe: To Deeksha Shenoy Pin
hevesir20-Oct-14 3:19
hevesir20-Oct-14 3:19 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 3:27
mveOriginalGriff20-Oct-14 3:27 
GeneralRe: To Deeksha Shenoy Pin
hevesir20-Oct-14 11:11
hevesir20-Oct-14 11:11 
GeneralRe: To Deeksha Shenoy Pin
OriginalGriff20-Oct-14 11:39
mveOriginalGriff20-Oct-14 11:39 
QuestionDrawing player "tokens" in TableLayoutCell Pin
Member 1116046719-Oct-14 21:08
Member 1116046719-Oct-14 21:08 
Hi guys, it me again!

I really appreciated your help in the last part of this exercise im currently working on, and could really use some advice on this new part im stuck on.

am working on an exercise in which we are given an incomplete project file. The project was to create a board game which lets up to six people play (fairly simple in theory). The part I am currently stuck on is showing the player "tokens" on the board.

This is what the final board is meant to look like:

http://i.stack.imgur.com/dcdy8.png[^]

As you can see, the on "0" (start square) there are 6 circles (or tokens) and on the right side there is a datagrid view with columns showing relevant information (colour, name, money, winner).

This is what I have been able to do so far:

http://i.stack.imgur.com/jxRh1.png[^]

As you see, I have been able to show the player name, and money. Though I cannot get the colour to show up in the start square or the data grid view. Instead, I get this:

http://i.stack.imgur.com/oPtMA.png[^]

The relevant classess/methods are these:

(IM just going to post the stack overflow link, since the formatting is already done there, but I was unable to get help from there)

http://stackoverflow.com/questions/26458550/drawing-board-game-tokens-to-board-and-datagrid-view[^]

So far, this is my understanding. I know I need to work with the ResetGame() Method in the HareandTortoiseForm.Cs class, but I very very lost on what to do. The description given to us of the method is:

/// <summary>
       /// Resets the game, including putting all the players on the Start square.
       /// This requires updating what is displayed in the GUI,
       /// as well as resetting the attrtibutes of HareAndTortoiseGame .
       /// This method is used by both the Reset button and
       /// when a new value is chosen in the Number of Players ComboBox.
       /// Pre:  none.
       /// Post: the form displays the game in the same state as when the program first starts
       ///       (except that any user names that the player has entered are not reset).
       /// </summary>




Again, I would really appreciate guidance.

EDIT1:

Okay, So I have gone through and read class/method comments again and would I think I know what I'm meant to be doing (not exactly sure how, but hey, getting somewhere).

This is what I'm referring to:

XML
/// <summary>
        /// At several places in the program's code, it is necessary to update the GUI board,
        /// so that player's tokens (or "pieces") are removed from their old squares
        /// or added to their new squares. E.g. when all players are moved back to the Start.
        ///
        /// For each of the players, this method is to use the GetSquareNumberOfPlayer method to find out
        /// which square number the player is on currently, then use the SquareControlAt method
        /// to find the corresponding SquareControl, and then update that SquareControl so that it
        /// knows whether the player is on that square or not.
        ///
        /// Moving all players from their old to their new squares requires this method to be called twice:
        /// once with the parameter typeOfGuiUpdate set to RemovePlayer, and once with it set to AddPlayer.
        /// In between those two calls, the players locations must be changed by using one or more methods
        /// in the HareAndTortoiseGame class. Otherwise, you won't see any change on the screen.
        ///
        /// Because this method moves ALL players, it should NOT be used when animating a SINGLE player's
        /// movements from square to square.
        ///
        ///
        /// Post: the GUI board is updated to match the locations of all Players objects.
        /// </summary>
        /// <param name="typeOfGuiUpdate">Specifies whether all the players are being removed
        /// from their old squares or added to their new squares</param>
        private void UpdatePlayersGuiLocations(TypeOfGuiUpdate typeOfGuiUpdate) {



            //##################### Code needs to be added here. ############################################################


            RefreshBoardTablePanelLayout(); // Must be the last line in this method. DO NOT put it inside a loop.
        }// end UpdatePlayersGuiLocations


EDIT 2:

I was talking to a class fellow who said I had to do something Like this in the Updateplayersguilocations method, though he was helpful, I would really like your input.

He said that something like this:

getSquarecontrolat(square the player is on).contains = bool[] of all players on that square

modified 20-Oct-14 3:32am.

QuestionThe Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file Pin
lan160719-Oct-14 13:38
lan160719-Oct-14 13:38 
AnswerRe: The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file Pin
Richard MacCutchan19-Oct-14 21:42
mveRichard MacCutchan19-Oct-14 21:42 
QuestionHow to merge image using Emgu CV library after comparison Pin
Tridip Bhattacharjee17-Oct-14 23:40
professionalTridip Bhattacharjee17-Oct-14 23:40 
QuestionCan I use local method in method Pin
Member 1115157117-Oct-14 20:57
Member 1115157117-Oct-14 20:57 
AnswerRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 21:45
mveOriginalGriff17-Oct-14 21:45 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 21:54
Member 1115157117-Oct-14 21:54 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:18
mveOriginalGriff17-Oct-14 22:18 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 22:43
Member 1115157117-Oct-14 22:43 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 22:54
mveOriginalGriff17-Oct-14 22:54 
GeneralRe: Can I use local method in method Pin
Member 1115157117-Oct-14 23:42
Member 1115157117-Oct-14 23:42 
GeneralRe: Can I use local method in method Pin
OriginalGriff17-Oct-14 23:52
mveOriginalGriff17-Oct-14 23:52 
GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:06
Member 1115157118-Oct-14 0:06 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:10
mveOriginalGriff18-Oct-14 0:10 
GeneralRe: Can I use local method in method Pin
Member 1115157118-Oct-14 0:15
Member 1115157118-Oct-14 0:15 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 0:21
mveOriginalGriff18-Oct-14 0:21 
GeneralRe: Can I use local method in method Pin
BillWoodruff18-Oct-14 1:45
professionalBillWoodruff18-Oct-14 1:45 
GeneralRe: Can I use local method in method Pin
OriginalGriff18-Oct-14 1:55
mveOriginalGriff18-Oct-14 1:55 

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.