Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: Looks like C# does not support Global Variables Pin
Brian_TheLion29-Mar-19 3:39
Brian_TheLion29-Mar-19 3:39 
GeneralRe: Looks like C# does not support Global Variables Pin
OriginalGriff1-Apr-19 20:01
mveOriginalGriff1-Apr-19 20:01 
GeneralRe: Looks like C# does not support Global Variables Pin
Brian_TheLion2-Apr-19 1:04
Brian_TheLion2-Apr-19 1:04 
GeneralRe: Looks like C# does not support Global Variables Pin
Brian_TheLion2-Apr-19 14:23
Brian_TheLion2-Apr-19 14:23 
GeneralRe: Looks like C# does not support Global Variables Pin
#realJSOP29-Mar-19 2:28
mve#realJSOP29-Mar-19 2:28 
AnswerRe: Looks like C# does not support Global Variables Pin
OriginalGriff28-Mar-19 0:20
mveOriginalGriff28-Mar-19 0:20 
GeneralRe: Looks like C# does not support Global Variables Pin
Brian_TheLion28-Mar-19 0:26
Brian_TheLion28-Mar-19 0:26 
GeneralRe: Looks like C# does not support Global Variables Pin
OriginalGriff28-Mar-19 0:40
mveOriginalGriff28-Mar-19 0:40 
That's why you have a Room class, and a Player class. Part of the Player Location is the Room he is in ...

You are thinking in a "C" language way, not an OOPs way - and that won't help you at all with C# apps. Start considering your game as composed of objects which "know" how to do things to themselves instead of trying to think of the "program" as being in charge and deciding what to do.

For example, a Player might have a WalkForward method, which internally finds the Room he is in, finds his location in the room, finds which way he is facing, and asks the Room to move one step in that direction. The Room checks if there is a wall in the way, or a pit full of Grues, or a heavy weight about to drop on that square and returns a result to the Player method which updates its location or takes damage. The Room doesn't care which player it is, the Player doesn't care which Room it is - they just use the data they have to work with any Room / Player combination.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Looks like C# does not support Global Variables Pin
Brian_TheLion28-Mar-19 1:00
Brian_TheLion28-Mar-19 1:00 
GeneralRe: Looks like C# does not support Global Variables Pin
OriginalGriff28-Mar-19 2:35
mveOriginalGriff28-Mar-19 2:35 
QuestionReading Registry Values Pin
ormonds27-Mar-19 15:33
ormonds27-Mar-19 15:33 
AnswerRe: Reading Registry Values Pin
Super Lloyd27-Mar-19 19:38
Super Lloyd27-Mar-19 19:38 
AnswerRe: Reading Registry Values Pin
OriginalGriff27-Mar-19 20:35
mveOriginalGriff27-Mar-19 20:35 
AnswerRe: Reading Registry Values Pin
Luc Pattyn27-Mar-19 22:01
sitebuilderLuc Pattyn27-Mar-19 22:01 
QuestionOData InvalidOperationException. Bad Request - Error in query syntax Pin
Bastien Vandamme26-Mar-19 16:13
Bastien Vandamme26-Mar-19 16:13 
AnswerRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Gerry Schmitz26-Mar-19 20:40
mveGerry Schmitz26-Mar-19 20:40 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Eddy Vluggen27-Mar-19 3:35
professionalEddy Vluggen27-Mar-19 3:35 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Pete O'Hanlon27-Mar-19 3:50
mvePete O'Hanlon27-Mar-19 3:50 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Eddy Vluggen27-Mar-19 4:15
professionalEddy Vluggen27-Mar-19 4:15 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Richard MacCutchan27-Mar-19 4:33
mveRichard MacCutchan27-Mar-19 4:33 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Eddy Vluggen27-Mar-19 4:38
professionalEddy Vluggen27-Mar-19 4:38 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Richard MacCutchan27-Mar-19 5:05
mveRichard MacCutchan27-Mar-19 5:05 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Eddy Vluggen27-Mar-19 5:31
professionalEddy Vluggen27-Mar-19 5:31 
GeneralRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
Gerry Schmitz27-Mar-19 6:16
mveGerry Schmitz27-Mar-19 6:16 
AnswerRe: OData InvalidOperationException. Bad Request - Error in query syntax Pin
dan!sh 27-Mar-19 3:58
professional dan!sh 27-Mar-19 3:58 

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.