Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
TowerDefense/src/MapTowerDefense.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46 lines (34 sloc)
771 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MapTowerDefense { | |
private int maxTowers; | |
private int numNodes; | |
private int[][] nodes; | |
private MinionFactory MF; | |
private TowerFactory TF; | |
private MockGui MG; | |
public MapTowerDefense(int _maxTowers, int _numNodes, int[][] _nodes, MockGui _mg) { | |
maxTowers = _maxTowers; | |
numNodes = _numNodes; | |
nodes = _nodes; | |
MF = new MinionFactory(nodes[0][0], nodes[0][1], this); | |
TF = new TowerFactory(this, maxTowers); | |
MG = _mg; | |
} | |
public MinionFactory getMF() { | |
return MF; | |
} | |
public TowerFactory getTF() { | |
return TF; | |
} | |
public int getNum() { | |
return numNodes; | |
} | |
public int[][] getNodes() { | |
return nodes; | |
} | |
public MockGui getGui() { | |
return MG; | |
} | |
public void createMinion(MinionTypes type) { | |
MF.createMinion(type); | |
} | |
} |