Coverage Summary for Class: Faction (com.mygdx.game)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| Faction | 100% (1/1) | 100% (6/6) | 100% (14/14) |
1 package com.mygdx.game; 2 3 import com.badlogic.gdx.math.Vector2; 4 5 /** 6 * Represents a faction contains data largly sourced from GameSettings 7 */ 8 public class Faction { 9 private String name; 10 private String shipColour; 11 private Vector2 position, spawnPos; 12 public int id = -1; 13 14 public Faction() { 15 name = "Faction not named"; 16 shipColour = ""; 17 } 18 19 /** 20 * Creates a faction with the specified name, colour, and in-game location. 21 * 22 * @param name name of faction 23 * @param colour colour name (used as prefix to retrieve ship sprites) 24 * @param pos 2D vector location 25 */ 26 public Faction(String name, String colour, Vector2 pos, Vector2 spawn, int id) { 27 this(); 28 this.name = name; 29 this.shipColour = colour; 30 this.position = pos; 31 spawnPos = spawn; 32 this.id = id; 33 } 34 35 public String getName() { 36 return name; 37 } 38 39 public String getColour() { 40 return shipColour; 41 } 42 43 public Vector2 getPosition() { 44 return position; 45 } 46 47 public Vector2 getSpawnPos() { 48 return spawnPos; 49 } 50 }