-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIServices.java
More file actions
31 lines (20 loc) · 727 Bytes
/
IServices.java
File metadata and controls
31 lines (20 loc) · 727 Bytes
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
package org.example.services;
import org.example.models.*;
public interface IServices {
boolean canBuyWeapon(WeaponModel weapon, int playerScore);
boolean isPerfectNumber(int artifactCode);
boolean isPrime(int artifact);
boolean isTrap(int artifact);
default boolean isSumDivBy3(int artifact) {
int sum = 0;
int num = artifact;
while (num != 0) {
sum += num % 10;
num /= 10;
}
return sum % 3 == 0;
}
boolean myWinProbability(PlayerStatus opponent, PlayerStatus self);
double getDistance(PlayerStatus opponent, PlayerStatus self);
boolean opponentWins(PlayerStatus opponent, double distance, WeaponModel myWeapon);
}