Advertisement
wreed12345

Untitled

Dec 29th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.98 KB | None | 0 0
  1. package com.willie.compsci;
  2.  
  3. /**
  4.  * Wrapper class to represent the keys that a particular character may use. Two characters can use
  5.  * the same instance of this class and will thus move under the same controls.
  6.  *
  7.  * @author William Reed
  8.  */
  9. public class CharacterController {
  10.  
  11.     private int jumpKey, leftKey, rightKey, fallKey, fireKey;
  12.  
  13.     /**
  14.      *
  15.      * @param jumpKey
  16.      * @param leftKey
  17.      * @param rightKey
  18.      */
  19.     public CharacterController(int jumpKey, int leftKey, int rightKey, int fallKey, int fireKey) {
  20.         this.jumpKey = jumpKey;
  21.         this.leftKey = leftKey;
  22.         this.rightKey = rightKey;
  23.         this.fallKey = fallKey;
  24.         this.fireKey = fireKey;
  25.     }
  26.  
  27.     /**
  28.      * @return the key associated with jumping
  29.      */
  30.     public int getJumpKey() {
  31.         return jumpKey;
  32.     }
  33.  
  34.     /**
  35.      * Set the key associated with jumping
  36.      *
  37.      * @param jumpKey the int for the key
  38.      */
  39.     public void setJumpKey(int jumpKey) {
  40.         this.jumpKey = jumpKey;
  41.     }
  42.  
  43.     /**
  44.      * @return the key associated with left movement
  45.      */
  46.     public int getLeftKey() {
  47.         return leftKey;
  48.     }
  49.  
  50.     /**
  51.      * Set the key associated with moving left
  52.      *
  53.      * @param leftKey the int for the key
  54.      */
  55.     public void setLeftKey(int leftKey) {
  56.         this.leftKey = leftKey;
  57.     }
  58.  
  59.     /**
  60.      * @return the key associated with right movement
  61.      */
  62.     public int getRightKey() {
  63.         return rightKey;
  64.     }
  65.  
  66.     /**
  67.      * Set the key associated with moving right
  68.      *
  69.      * @param rightKey the int for the key
  70.      */
  71.     public void setRightKey(int rightKey) {
  72.         this.rightKey = rightKey;
  73.     }
  74.     public int getFallKey(){
  75.         return fallKey;
  76.     }
  77.     public void setFallKey(int fallKey){
  78.         this.fallKey = fallKey;
  79.     }
  80.     public int getFireKey(){
  81.         return fireKey;
  82.     }
  83.     public void setFireKey(int fireKey){
  84.         this.fireKey = fireKey;
  85.     }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement