~vedu/mafia-android/master

« back to all changes in this revision

Viewing changes to src/com/vedant/mafia/backend/Person.java

  • Committer: Vedant Agrwala
  • Date: 2013-11-14 09:10:05 UTC
  • Revision ID: vedant.kota@gmail.com-20131114091005-mv8oabe8o4fugzo8
Initial work

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.vedant.mafia.backend;
 
2
 
 
3
public enum Person {
 
4
        CIVILIAN(Action.NOTHING),
 
5
        MAFIA(Action.SUGGEST),
 
6
        GODFATHER(Action.KILL),
 
7
        HITMAN(Action.KILL),
 
8
        POLICE(Action.CHECK),
 
9
        WITCH(Action.SLEEP),
 
10
        ANGEL(Action.SAVE);
 
11
        
 
12
        public final Action action;
 
13
        
 
14
        private Person(Action action){
 
15
                this.action = action;
 
16
        }
 
17
        
 
18
        public boolean isMafia(){
 
19
                switch (this){
 
20
                case MAFIA:
 
21
                case GODFATHER:
 
22
                case HITMAN:
 
23
                        return true;
 
24
                default:
 
25
                        return false;
 
26
                }
 
27
        }
 
28
        
 
29
        public boolean thumbsUp(){
 
30
                switch (this){
 
31
                case MAFIA:
 
32
                case HITMAN:
 
33
                        return true;
 
34
                default:
 
35
                        return false;
 
36
                }
 
37
        }
 
38
}