You can't surely be serious. I get that its a snippet but it's near useless. You haven't actually done much of anything. You should beef it up and create a more advanced way of handling quest stages.
|
|
I didn't take the time to count how many quests are in the quest journal but I doubt anyone has 50 quest on there server so adjust the constant to your liking.
This will eliminate having to create and save a variable for each quest.
Code:package com.model.actor.player; /** * * @author Purple Helix * */ public class PlayerQuests { /** * Array span of quests. */ private Integer[] quest = new Integer[MAX_QUESTS]; /** * Gets quests. * @return */ public Integer[] getQuest() { for (int i = 0; i < quest.length; i++) { if (quest[i] == null) { quest[i] = 0; } } return quest; } /** * Sets the quest stage. * @param quest * @param stage */ public void setQuestStage(Integer quest, Integer stage) { this.quest[quest] = stage; } public static final int BLACK_KNIGHTS_FORTRESS = 0; public static final int MAX_QUESTS = 50; }
You can't surely be serious. I get that its a snippet but it's near useless. You haven't actually done much of anything. You should beef it up and create a more advanced way of handling quest stages.

Are you kidding me..

why are you using boxed primitives
why did you even post this

what even is this? you're supposed to use abstraction
From looking at it and reading the posts in the thread this is basically a way to save quest as apposed to creating single integer per quest.
as for "you're supposed to use abstraction"
This obviously isn't a quest system, but if you where to make one a interface or a abstract class would be appropriate.
This is better then what comes with PI so why make so much commotion over something honestly. You wonder why people never give back to our community as much as they would like to cause of idiots like you guy's.
| « Project Insanity - Sell item in inventory / Sell all items in inventory Command | [ALMOST ANY] Suggestion Command » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |