Click here to Skip to main content
15,906,329 members
Home / Discussions / C#
   

C#

 
AnswerRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 11:57
professionalDr.Walt Fair, PE5-May-10 11:57 
GeneralRe: Adding text box input to a dataset table Pin
mprice2145-May-10 12:13
mprice2145-May-10 12:13 
GeneralRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 15:10
professionalDr.Walt Fair, PE5-May-10 15:10 
GeneralRe: Adding text box input to a dataset table [modified] Pin
mprice2145-May-10 15:45
mprice2145-May-10 15:45 
GeneralRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 16:47
professionalDr.Walt Fair, PE5-May-10 16:47 
QuestionMessage Removed Pin
5-May-10 9:16
professionalN_tro_P5-May-10 9:16 
QuestionEnum logic problem [modified] Pin
venomation5-May-10 8:02
venomation5-May-10 8:02 
AnswerRe: Enum logic problem Pin
Ian Shlasko5-May-10 8:19
Ian Shlasko5-May-10 8:19 
I would suggest breaking this down a bit more logically... Assuming you plan on adding more animation types, each with its own list of animations, you're going to have a huge collection of enums and no real organization at all... So here's what I would do...

Make a StickMan class, and have it implement a common interface (So you can add more similar classes later)... Let's just call it IAnimationContainer, for example:
public interface IAnimationContainer
{
  Animation GetAnimation(string name);
}

public class StickMan : IAnimationContainer
{
  private Dictionary<string, Animation> _animations = new Dictionary<string, Animation>();

  public StickMan()
  {
    _animations.Add("Walk", new WalkAnimation());
  }

  public Animation GetAnimation(string name)
  {
    return _animations[name];
  }
}

Then, you use your dictionary to index AnimTypes to the actual classes...
animations.Add(AnimType.StickMan, new StickMan());

And to get the actual animation:
animations[AnimType.StickMan].GetAnimation("Walk");

Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

AnswerRe: Enum logic problem Pin
venomation5-May-10 8:24
venomation5-May-10 8:24 
Questiondocument code Pin
toto_20105-May-10 7:13
toto_20105-May-10 7:13 
AnswerRe: document code Pin
dan!sh 5-May-10 7:24
professional dan!sh 5-May-10 7:24 
AnswerRe: document code Pin
Richard MacCutchan5-May-10 7:26
mveRichard MacCutchan5-May-10 7:26 
AnswerRe: document code Pin
Pete O'Hanlon5-May-10 9:26
mvePete O'Hanlon5-May-10 9:26 
AnswerRe: document code Pin
Dave Kreskowiak5-May-10 9:32
mveDave Kreskowiak5-May-10 9:32 
AnswerRe: document code Pin
Peace ON5-May-10 21:03
Peace ON5-May-10 21:03 
QuestionDate formate changing in Italian settings Pin
attalurisubbu5-May-10 5:28
attalurisubbu5-May-10 5:28 
AnswerRe: Date formate changing in Italian settings Pin
Not Active5-May-10 5:55
mentorNot Active5-May-10 5:55 
AnswerRe: Date formate changing in Italian settings Pin
dan!sh 5-May-10 6:26
professional dan!sh 5-May-10 6:26 
AnswerRe: Date formate changing in Italian settings Pin
The Man from U.N.C.L.E.5-May-10 6:48
The Man from U.N.C.L.E.5-May-10 6:48 
QuestionParsing JSON Pin
harsimranb5-May-10 5:18
harsimranb5-May-10 5:18 
AnswerRe: Parsing JSON Pin
OriginalGriff5-May-10 5:39
mveOriginalGriff5-May-10 5:39 
AnswerRe: Parsing JSON Pin
Kythen5-May-10 11:32
Kythen5-May-10 11:32 
GeneralRe: Parsing JSON Pin
harsimranb5-May-10 12:03
harsimranb5-May-10 12:03 
QuestionBuffering video files Pin
TimSWatson5-May-10 4:12
TimSWatson5-May-10 4:12 
AnswerRe: Buffering video files Pin
Peace ON5-May-10 4:27
Peace ON5-May-10 4:27 

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.