-
-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved ability and tool stuff from McMMOPlayer to SkillManager classes
Warning: Because Woodcutting and Repair don't have a "proper" manager class, this doesn't work yet.
- Loading branch information
Showing
14 changed files
with
174 additions
and
198 deletions.
There are no files selected for viewing
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
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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/com/gmail/nossr50/datatypes/skills/Tool.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.gmail.nossr50.datatypes.skills; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import com.gmail.nossr50.util.Misc; | ||
|
||
public class Tool { | ||
private static Map<ToolType, Tool> tools = new HashMap<ToolType, Tool>(); | ||
private boolean preparationMode = true; | ||
private long preparationATS; | ||
|
||
private Tool(ToolType toolType) { | ||
tools.put(toolType, this); | ||
} | ||
|
||
public boolean getPreparationMode() { | ||
return preparationMode; | ||
} | ||
|
||
public void setPreparationMode(boolean preparationMode) { | ||
this.preparationMode = preparationMode; | ||
} | ||
|
||
public long getPreparationATS() { | ||
return preparationATS; | ||
} | ||
|
||
public void setPreparationATS(long toolPreparationATS) { | ||
int startTime = (int) (toolPreparationATS / Misc.TIME_CONVERSION_FACTOR); | ||
|
||
preparationATS = startTime; | ||
} | ||
|
||
public static Tool getTool(ToolType toolType) { | ||
Tool tool = tools.get(toolType); | ||
|
||
if (tool == null) { | ||
tool = new Tool(toolType); | ||
} | ||
|
||
return tool; | ||
} | ||
} |
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
Oops, something went wrong.