Refactoring (#1660)

* Refactor a couple of iterators

* Use side-effect instead of second iterator

* Make World::onTick return shouldDelete instead of success

* Replace Shop iterator with side effects

* Scene

* Clean up Expeditions

* Refactor Expeditions

* Clean up Expeditions, Player

* Limit Expeditions by AR

* Lombokify props

Co-authored-by: AnimeGitB <AnimeGitB@bigblueball.in>
This commit is contained in:
Luke H-W
2022-08-15 23:19:13 +09:30
committed by GitHub
parent bccf516ca7
commit dc9cef8ab7
23 changed files with 263 additions and 711 deletions

View File

@@ -1,44 +1,24 @@
package emu.grasscutter.game.expedition;
import dev.morphia.annotations.Entity;
import emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter @Setter
public class ExpeditionInfo {
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public int getExpId() {
return expId;
}
public void setExpId(int expId) {
this.expId = expId;
}
public int getHourTime() {
return hourTime;
}
public void setHourTime(int hourTime) {
this.hourTime = hourTime;
}
public int getStartTime() {
return startTime;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
private int state;
private int expId;
private int hourTime;
private int startTime;
public AvatarExpeditionInfo toProto() {
return AvatarExpeditionInfo.newBuilder()
.setStateValue(this.getState())
.setExpId(this.getExpId())
.setHourTime(this.getHourTime())
.setStartTime(this.getStartTime())
.build();
}
}