|
@@ -19,7 +19,7 @@
|
|
package com.iohao.mmo.person.service;
|
|
package com.iohao.mmo.person.service;
|
|
|
|
|
|
import com.iohao.mmo.hero.service.HeroService;
|
|
import com.iohao.mmo.hero.service.HeroService;
|
|
-import com.iohao.mmo.person.entity.BasicsProperty;
|
|
|
|
|
|
+import com.iohao.mmo.person.entity.BasicProperty;
|
|
import com.iohao.mmo.person.entity.Hero;
|
|
import com.iohao.mmo.person.entity.Hero;
|
|
import com.iohao.mmo.person.entity.Person;
|
|
import com.iohao.mmo.person.entity.Person;
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
@@ -58,18 +58,18 @@ public class PersonService {
|
|
|
|
|
|
private void createPerson(long userId) {
|
|
private void createPerson(long userId) {
|
|
// 人物基础属性
|
|
// 人物基础属性
|
|
- BasicsProperty basicProperty = getInitBasicProperty();
|
|
|
|
|
|
+ BasicProperty basicProperty = getInitBasicProperty();
|
|
|
|
|
|
Hero firstHero = heroService.getFirstHero();
|
|
Hero firstHero = heroService.getFirstHero();
|
|
|
|
|
|
- BasicsProperty plus = basicProperty.plus(firstHero.getBasicsProperty());
|
|
|
|
|
|
+ BasicProperty plus = basicProperty.plus(firstHero.getBasicProperty());
|
|
|
|
|
|
- firstHero.setBasicsProperty(plus);
|
|
|
|
|
|
+ firstHero.setBasicProperty(plus);
|
|
|
|
|
|
Person person = new Person();
|
|
Person person = new Person();
|
|
person.setId(String.valueOf(userId));
|
|
person.setId(String.valueOf(userId));
|
|
person.setBasicProperty(basicProperty);
|
|
person.setBasicProperty(basicProperty);
|
|
- person.setHeroes(List.of(firstHero));
|
|
|
|
|
|
+ person.setHeroList(List.of(firstHero));
|
|
person.setCurrentHero(firstHero);
|
|
person.setCurrentHero(firstHero);
|
|
|
|
|
|
mongoTemplate.save(person);
|
|
mongoTemplate.save(person);
|
|
@@ -79,8 +79,8 @@ public class PersonService {
|
|
return mongoTemplate.findById(String.valueOf(userId), Person.class);
|
|
return mongoTemplate.findById(String.valueOf(userId), Person.class);
|
|
}
|
|
}
|
|
|
|
|
|
- private BasicsProperty getInitBasicProperty() {
|
|
|
|
- BasicsProperty basicProperty = new BasicsProperty();
|
|
|
|
|
|
+ private BasicProperty getInitBasicProperty() {
|
|
|
|
+ BasicProperty basicProperty = new BasicProperty();
|
|
basicProperty.setHp(100);
|
|
basicProperty.setHp(100);
|
|
basicProperty.setMp(100);
|
|
basicProperty.setMp(100);
|
|
basicProperty.setPhysicsAttack(20);
|
|
basicProperty.setPhysicsAttack(20);
|