Compare commits
5 Commits
41e82f91c1
...
07aeee82d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07aeee82d0 | ||
|
|
a0f8a1ec96 | ||
|
|
f724eac193 | ||
|
|
31be71a1d2 | ||
|
|
3924e206f6 |
|
|
@ -5,8 +5,10 @@ import com.hivekion.common.redis.RedisUtil;
|
||||||
import com.hivekion.common.uuid.IdUtils;
|
import com.hivekion.common.uuid.IdUtils;
|
||||||
import com.hivekion.room.RoomManager;
|
import com.hivekion.room.RoomManager;
|
||||||
import com.hivekion.room.func.TaskAction;
|
import com.hivekion.room.func.TaskAction;
|
||||||
|
import com.hivekion.scenario.entity.BattleConsume;
|
||||||
import com.hivekion.scenario.entity.ScenarioResource;
|
import com.hivekion.scenario.entity.ScenarioResource;
|
||||||
import com.hivekion.scenario.entity.ScenarioTask;
|
import com.hivekion.scenario.entity.ScenarioTask;
|
||||||
|
import com.hivekion.scenario.service.impl.BattleConsumeServiceImpl;
|
||||||
import com.hivekion.scenario.service.impl.BattleSupplierServiceImpl;
|
import com.hivekion.scenario.service.impl.BattleSupplierServiceImpl;
|
||||||
import com.hivekion.scenario.service.impl.ScenarioTaskServiceImpl;
|
import com.hivekion.scenario.service.impl.ScenarioTaskServiceImpl;
|
||||||
import com.hivekion.statistic.bean.StatisticBean;
|
import com.hivekion.statistic.bean.StatisticBean;
|
||||||
|
|
@ -50,7 +52,7 @@ public class MoveRootTask extends AbtParentTask implements TaskAction {
|
||||||
/**
|
/**
|
||||||
* 消耗任务间隔
|
* 消耗任务间隔
|
||||||
*/
|
*/
|
||||||
private final int consumptionTaskInterval = 5;
|
private final int consumptionTaskInterval = 10;
|
||||||
/**
|
/**
|
||||||
* redis 服务类
|
* redis 服务类
|
||||||
*/
|
*/
|
||||||
|
|
@ -124,6 +126,8 @@ public class MoveRootTask extends AbtParentTask implements TaskAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//插入消耗表
|
//插入消耗表
|
||||||
|
insertConsumption(currentUseUp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -172,6 +176,18 @@ public class MoveRootTask extends AbtParentTask implements TaskAction {
|
||||||
RoomManager.addAction(roomId, 0, supplierTask);
|
RoomManager.addAction(roomId, 0, supplierTask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void insertConsumption(double num) {
|
||||||
|
BattleConsume battleConsume = new BattleConsume();
|
||||||
|
battleConsume.setId(IdUtils.simpleUUID());
|
||||||
|
battleConsume.setResourceId(scenarioTask.getResourceId());
|
||||||
|
battleConsume.setFuel(num);
|
||||||
|
battleConsume.setConsumeDate(LocalDateTime.now());
|
||||||
|
SpringUtil.getBean(BattleConsumeServiceImpl.class).save(battleConsume);
|
||||||
|
}
|
||||||
|
private void pushStatus(double num){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,8 @@ public class Room implements AutoCloseable {
|
||||||
status.set(true);
|
status.set(true);
|
||||||
totalTime.set(time);
|
totalTime.set(time);
|
||||||
startTask();
|
startTask();
|
||||||
|
//初始化系统资源 物资人员等信息
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -195,4 +197,8 @@ public class Room implements AutoCloseable {
|
||||||
public boolean isRunning() {
|
public boolean isRunning() {
|
||||||
return status.get();
|
return status.get();
|
||||||
}
|
}
|
||||||
|
//统一推送方法
|
||||||
|
protected void pushStatus(String resourceId){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user