Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
switch statements
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#6
RE: switch statements

The cases don't have to be integers. You can do this

AddTimer("timerone", 1, "TimerFunction");
AddTimer("timertwo", 2, "TimerFunction");
AddTimer("timerthree", 3, "TimerFunction");


void TimerFunction(string &in timer)
{
    switch(timer) {
        case timerone:
            //cool stuff
        break;
        case timertwo:
            //cool stuff
        break;
        case timerthree:
            //cool stuff
        break;
    }
}

07-20-2011, 08:46 PM
Find


Messages In This Thread
switch statements - by DRedshot - 07-20-2011, 08:00 PM
RE: switch statements - by Khyrpa - 07-20-2011, 08:24 PM
RE: switch statements - by Kyle - 07-20-2011, 08:31 PM
RE: switch statements - by Khyrpa - 07-20-2011, 08:38 PM
RE: switch statements - by DRedshot - 07-20-2011, 08:42 PM
RE: switch statements - by palistov - 07-20-2011, 08:46 PM
RE: switch statements - by DRedshot - 07-20-2011, 08:49 PM
RE: switch statements - by palistov - 07-22-2011, 10:34 AM



Users browsing this thread: 1 Guest(s)