Package Files

Class Card

java.lang.Object
Files.Card

public class Card extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Card(boolean horse, boolean cannon, boolean troop)
    Constructs a card object
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Accessor method to get the value of the cannon instance variable
    boolean
    Accessor method to get the value of the horse instance variable
    boolean
    Accessor method to get the value of the troop instance variable
    toString method for the card object

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Card

      public Card(boolean horse, boolean cannon, boolean troop)
      Constructs a card object
      Parameters:
      horse - determines whether or not the car has a horse on it
      cannon - determines whether or not the card has a cannon on it
      troop - determines whether or not the card has a troop on it
  • Method Details

    • getHorse

      public boolean getHorse()
      Accessor method to get the value of the horse instance variable
      Returns:
      boolean value of horse instance variable
    • getCannon

      public boolean getCannon()
      Accessor method to get the value of the cannon instance variable
      Returns:
      boolean value of the cannon instance variable
    • getTroop

      public boolean getTroop()
      Accessor method to get the value of the troop instance variable
      Returns:
      boolean value of the cannon instance variable
    • toString

      public String toString()
      toString method for the card object
      Overrides:
      toString in class Object
      Returns:
      String type of card: Horse, Cannon, Troop, or Joker