We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
The text was updated successfully, but these errors were encountered:
Mark property as replicable easier way?
Sorry, something went wrong.
Maybe use proxy and in proxy send socket-io request to server
https://stackoverflow.com/a/50723478/5909875
https://www.npmjs.com/package/proxy-deep
https://www.npmjs.com/package/@qiwi/deep-proxy
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: