feat: Interaction memory

This commit is contained in:
jzitnik-dev 2024-12-30 13:14:16 +01:00
parent 53b4e9090e
commit a05788c53b
Signed by: jzitnik
GPG Key ID: C577A802A6AF4EF3
2 changed files with 11 additions and 1 deletions

View File

@ -2,7 +2,6 @@ package cz.jzitnik.chronos.entities;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@ -31,4 +30,11 @@ public class Interaction {
this.interactedWithText = interactedWithText; this.interactedWithText = interactedWithText;
this.character = character; this.character = character;
} }
@JsonIgnore
private String memory;
@ManyToOne
@JsonIgnore
private Player player;
} }

View File

@ -55,6 +55,10 @@ public class Player {
@JsonIgnore @JsonIgnore
private List<Character> seenCharacters = new ArrayList<>(); private List<Character> seenCharacters = new ArrayList<>();
@OneToMany(mappedBy = "player", cascade = CascadeType.ALL)
@JsonIgnore
private List<Interaction> interactions = new ArrayList<>();
public Player(String name) { public Player(String name) {
this.name = name; this.name = name;
} }