UNPKG

@natewilcox/zelda-server

Version:

Server application for zelda multiplayer game

33 lines (32 loc) 1.31 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PlayerState = void 0; const schema_1 = require("@colyseus/schema"); class PlayerState extends schema_1.Schema { constructor(id, clientId, x, y) { super(); this.id = id; this.clientId = clientId; this.x = x; this.y = y; } } exports.PlayerState = PlayerState; __decorate([ (0, schema_1.type)('number') ], PlayerState.prototype, "id", void 0); __decorate([ (0, schema_1.type)('string') ], PlayerState.prototype, "clientId", void 0); __decorate([ (0, schema_1.type)('number') ], PlayerState.prototype, "x", void 0); __decorate([ (0, schema_1.type)('number') ], PlayerState.prototype, "y", void 0);