Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probable Waffle Client - Server replication #128

Open
JernejHabjan opened this issue Nov 4, 2023 · 2 comments
Open

Probable Waffle Client - Server replication #128

JernejHabjan opened this issue Nov 4, 2023 · 2 comments

Comments

@JernejHabjan
Copy link
Owner

how to achieve this in typescript:

I have complex nested object of classes like this:

class GameState{
playTime = 0;
howLongPlaying(){...}
}
class Weapon{
attackDmg=10,
currentCooldown = 5
}
class Warrior{
health:100,
weapon: Weapon
attack(){...},
}
class Player{
warriors:Warrior[]=[]
getWarriors(){...}
getPlayerId(){...}
}

class Game{
gameState: GameState
players:Player[] = [];
}

I want to replicate this game object between server and client. How do I do that in Typescript? Server is NestJs, and client is Angular

@JernejHabjan
Copy link
Owner Author

Mark property as replicable easier way?

@JernejHabjan
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant