Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: NAT Traversal in C# (P2P behind firewalls/NAT Routers), UDP Hole Punching Pin
harold aptroot19-Apr-09 0:55
harold aptroot19-Apr-09 0:55 
GeneralRe: NAT Traversal in C# (P2P behind firewalls/NAT Routers), UDP Hole Punching Pin
lok.vikram30-Aug-10 20:01
lok.vikram30-Aug-10 20:01 
QuestionToolstrip Button Pin
nagendra.vk11-Apr-09 21:00
nagendra.vk11-Apr-09 21:00 
AnswerRe: Toolstrip Button Pin
Henry Minute12-Apr-09 1:33
Henry Minute12-Apr-09 1:33 
GeneralRegex Cheat-Sheet YAAAAAAY!!! :-D Pin
jas0n2311-Apr-09 20:35
jas0n2311-Apr-09 20:35 
GeneralRe: Regex Cheat-Sheet YAAAAAAY!!! :-D Pin
Eddy Vluggen11-Apr-09 21:58
professionalEddy Vluggen11-Apr-09 21:58 
GeneralOther .NET Cheat Sheets (including Regex) Pin
dybs12-Apr-09 6:31
dybs12-Apr-09 6:31 
GeneralRe: Regex Cheat-Sheet YAAAAAAY!!! :-D Pin
PIEBALDconsult12-Apr-09 7:22
mvePIEBALDconsult12-Apr-09 7:22 
QuestionDifferent size icons in treeview Pin
viciouskinid11-Apr-09 19:29
viciouskinid11-Apr-09 19:29 
AnswerRe: Different size icons in treeview Pin
Jimmanuel12-Apr-09 11:10
Jimmanuel12-Apr-09 11:10 
GeneralRe: Different size icons in treeview Pin
viciouskinid12-Apr-09 14:16
viciouskinid12-Apr-09 14:16 
GeneralRe: Different size icons in treeview Pin
Jimmanuel12-Apr-09 15:25
Jimmanuel12-Apr-09 15:25 
QuestionCreating events for another control to process; how may I? Pin
Acshi11-Apr-09 16:43
Acshi11-Apr-09 16:43 
AnswerRe: Creating events for another control to process; how may I? Pin
Luc 64801111-Apr-09 16:57
Luc 64801111-Apr-09 16:57 
GeneralRe: Creating events for another control to process; how may I? Pin
Acshi11-Apr-09 18:19
Acshi11-Apr-09 18:19 
AnswerRe: Creating events for another control to process; how may I? Pin
Eddy Vluggen11-Apr-09 22:05
professionalEddy Vluggen11-Apr-09 22:05 
QuestionTransactionScope vs oConn.BeginTransaction Pin
devvvy11-Apr-09 16:03
devvvy11-Apr-09 16:03 
AnswerRe: TransactionScope vs oConn.BeginTransaction Pin
S. Senthil Kumar11-Apr-09 20:23
S. Senthil Kumar11-Apr-09 20:23 
QuestionBest practice for using Registry - UAC Issues Pin
Brad Wick11-Apr-09 15:04
Brad Wick11-Apr-09 15:04 
AnswerRe: Best practice for using Registry - UAC Issues Pin
Mycroft Holmes11-Apr-09 15:50
professionalMycroft Holmes11-Apr-09 15:50 
AnswerRe: Best practice for using Registry - UAC Issues Pin
Luc 64801111-Apr-09 17:00
Luc 64801111-Apr-09 17:00 
QuestionWhat's the best method for calling a random function? Pin
tylocook11-Apr-09 13:43
tylocook11-Apr-09 13:43 
I am trying to find out the best practice for calling one function out a set at random. I am using this to establish a random event in a video game.

For instance, let's say over time a bunch of different things could happen to a plant over time. So, every 5 hours, a random thing happens to this plant (resulting in 1 of many functions being fired).

The current way I am thinking about this follows in this example:

A timer knows about a list of 100 plants. When the timer ticks, it is randomly decided that the InsectInfestation method will be fired and it will affect 30 plants.


Where is the best place to store these random event methods?
The plant? An interface to the plant?

What is the best method of firing one at random?
A delegate in the timer that queues up the methods contained in the 30 affected plants? If so, how do I call up these methods in an algorithm?

---------------
TyloCook

AnswerRe: What's the best method for calling a random function? Pin
PIEBALDconsult11-Apr-09 15:57
mvePIEBALDconsult11-Apr-09 15:57 
Questionhow to access sound card Pin
fitsum argaw11-Apr-09 13:18
fitsum argaw11-Apr-09 13:18 
AnswerRe: how to access sound card Pin
Henry Minute12-Apr-09 1:41
Henry Minute12-Apr-09 1:41 

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.