forked from CS162-Group35/GroupProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scissors.cpp
39 lines (36 loc) · 1.29 KB
/
scissors.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/******************************************************************************
* Authors: Sean Patrick Akins
* Edmund Dea
* Trevor Rollins
* Nathan Villegas
* Group: 35
* Class: CS162-400
* Date: 10/27/2017
* Title: Group Project
* Description: Defines the scissors class
******************************************************************************/
#include "scissors.hpp"
/******************************************************************************
* Function: Scissors
* Arguments: N/A
* Description: Default constructor for the Scissors class
******************************************************************************/
Scissors::Scissors() : Tool ()
{
Tool::setStrength(1);
Tool::setType('s');
}
/******************************************************************************
* Function: fight
* Arguments: Tool opponentChoice
* Description: Handles Scissors fighting against the opponent's Tool
******************************************************************************/
int Scissors::fight(Tool opponentChoice)
{
if(opponentChoice.getType() == 'r')
return (Tool::getStrength() / 2);
else if (opponentChoice.getType() == 'p')
return (Tool::getStrength() * 2);
else
return (Tool::getStrength());
}