2013-04-18 12:29:56 +02:00
|
|
|
package com.massivecraft.factions.task;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-22 09:37:53 +02:00
|
|
|
import com.massivecraft.factions.entity.FactionColl;
|
2013-04-22 12:26:13 +02:00
|
|
|
import com.massivecraft.factions.entity.FactionColls;
|
2013-04-24 08:39:26 +02:00
|
|
|
import com.massivecraft.factions.entity.MConf;
|
2013-04-18 13:36:52 +02:00
|
|
|
import com.massivecraft.mcore.ModuloRepeatTask;
|
2013-04-24 08:45:52 +02:00
|
|
|
import com.massivecraft.mcore.util.TimeUnit;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
public class TaskEconLandReward extends ModuloRepeatTask
|
2013-04-10 09:47:32 +02:00
|
|
|
{
|
2013-04-18 13:36:52 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
private static TaskEconLandReward i = new TaskEconLandReward();
|
|
|
|
public static TaskEconLandReward get() { return i; }
|
2013-04-18 13:36:52 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE: MODULO REPEAT TASK
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public long getDelayMillis()
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
return (long) (MConf.get().taskEconLandRewardMinutes * TimeUnit.MILLIS_PER_MINUTE);
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
2012-11-28 06:51:37 +01:00
|
|
|
@Override
|
2013-04-18 13:36:52 +02:00
|
|
|
public void setDelayMillis(long delayMillis)
|
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
MConf.get().taskEconLandRewardMinutes = delayMillis / (double) TimeUnit.MILLIS_PER_MINUTE;
|
2013-04-18 13:36:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void invoke()
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2013-04-22 12:26:13 +02:00
|
|
|
for (FactionColl coll : FactionColls.get().getColls())
|
|
|
|
{
|
|
|
|
coll.econLandRewardRoutine();
|
|
|
|
}
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|