Jump to content

Best data type for holding stance data about a player

- - - - -

  • Please log in to reply
2 replies to this topic

#1
liamzebedee

liamzebedee

    Programmer

  • Members
  • PipPipPipPip
  • 129 posts
What is the best data type in Java for holding data about what stance(standing-left, crouching-left etc.) a player(or any entity for that matter) is in. This is an example of what I would like in my code-

if (stance = stance.standingleft)

{

//render player left

}


//OR mabye a switch statement

switch(stance)

{

case "standing left":

//render player left

break;



#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Use an enum type. Enum Types (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

#3
liamzebedee

liamzebedee

    Programmer

  • Members
  • PipPipPipPip
  • 129 posts
Thanks




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users