How to use stryMutAct_9fa48 method in stryker-parent

Best JavaScript code snippet using stryker-parent

CoveyTownController.ts

Source:CoveyTownController.ts Github

copy

Full Screen

...30 }31 stryCov_9fa48 = cover;32 cover.apply(null, arguments);33}34function stryMutAct_9fa48(id) {35 var ns = stryNS_9fa48();36 function isActive(id) {37 if (ns.activeMutant === id) {38 if (ns.hitCount !== void 0 && ++ns.hitCount > ns.hitLimit) {39 throw new Error('Stryker: Hit count limit reached (' + ns.hitCount + ')');40 }41 return true;42 }43 return false;44 }45 stryMutAct_9fa48 = isActive;46 return isActive(id);47}48import { customAlphabet, nanoid } from 'nanoid';49import { BoundingBox, ServerConversationArea } from '../client/TownsServiceClient';50import { UserLocation } from '../CoveyTypes';51import CoveyTownListener from '../types/CoveyTownListener';52import Player from '../types/Player';53import PlayerSession from '../types/PlayerSession';54import IVideoClient from './IVideoClient';55import TwilioVideo from './TwilioVideo';56const friendlyNanoID = customAlphabet('1234567890ABCDEF', 8);57/**58 * The CoveyTownController implements the logic for each town: managing the various events that59 * can occur (e.g. joining a town, moving, leaving a town)60 */61export default class CoveyTownController {62 get capacity(): number {63 return this._capacity;64 }65 set isPubliclyListed(value: boolean) {66 this._isPubliclyListed = value;67 }68 get isPubliclyListed(): boolean {69 return this._isPubliclyListed;70 }71 get townUpdatePassword(): string {72 return this._townUpdatePassword;73 }74 get players(): Player[] {75 return this._players;76 }77 get occupancy(): number {78 return this._listeners.length;79 }80 get friendlyName(): string {81 return this._friendlyName;82 }83 set friendlyName(value: string) {84 this._friendlyName = value;85 }86 get coveyTownID(): string {87 return this._coveyTownID;88 }89 get conversationAreas(): ServerConversationArea[] {90 return this._conversationAreas;91 }92 /** The list of players currently in the town * */93 private _players: Player[] = [];94 /** The list of valid sessions for this town * */95 private _sessions: PlayerSession[] = [];96 /** The videoClient that this CoveyTown will use to provision video resources * */97 private _videoClient: IVideoClient = TwilioVideo.getInstance();98 /** The list of CoveyTownListeners that are subscribed to events in this town * */99 private _listeners: CoveyTownListener[] = [];100 /** The list of currently active ConversationAreas in this town */101 private _conversationAreas: ServerConversationArea[] = [];102 private readonly _coveyTownID: string;103 private _friendlyName: string;104 private readonly _townUpdatePassword: string;105 private _isPubliclyListed: boolean;106 private _capacity: number;107 constructor(friendlyName: string, isPubliclyListed: boolean) {108 this._coveyTownID = process.env.DEMO_TOWN_ID === friendlyName ? friendlyName : friendlyNanoID();109 this._capacity = 50;110 this._townUpdatePassword = nanoid(24);111 this._isPubliclyListed = isPubliclyListed;112 this._friendlyName = friendlyName;113 }114 /**115 * Adds a player to this Covey Town, provisioning the necessary credentials for the116 * player, and returning them117 *118 * @param newPlayer The new player to add to the town119 */120 async addPlayer(newPlayer: Player): Promise<PlayerSession> {121 const theSession = new PlayerSession(newPlayer);122 this._sessions.push(theSession);123 this._players.push(newPlayer); // Create a video token for this user to join this town124 theSession.videoToken = await this._videoClient.getTokenForTown(this._coveyTownID, newPlayer.id); // Notify other players that this player has joined125 this._listeners.forEach(listener => listener.onPlayerJoined(newPlayer));126 return theSession;127 }128 /**129 * Destroys all data related to a player in this town.130 *131 * @param session PlayerSession to destroy132 */133 destroySession(session: PlayerSession): void {134 this._players = this._players.filter(p => p.id !== session.player.id);135 this._sessions = this._sessions.filter(s => s.sessionToken !== session.sessionToken);136 this._listeners.forEach(listener => listener.onPlayerDisconnected(session.player));137 const conversation = session.player.activeConversationArea;138 if (stryMutAct_9fa48("1") ? false : stryMutAct_9fa48("0") ? true : (stryCov_9fa48("0", "1"), conversation)) {139 if (stryMutAct_9fa48("2")) {140 {}141 } else {142 stryCov_9fa48("2");143 this.removePlayerFromConversationArea(session.player, conversation);144 }145 }146 }147 /**148 * Updates the location of a player within the town149 * 150 * If the player has changed conversation areas, this method also updates the151 * corresponding ConversationArea objects tracked by the town controller, and dispatches152 * any onConversationUpdated events as appropriate153 * 154 * @param player Player to update location for155 * @param location New location for this player156 */157 updatePlayerLocation(player: Player, location: UserLocation): void {158 const conversation = this.conversationAreas.find(stryMutAct_9fa48("3") ? () => undefined : (stryCov_9fa48("3"), conv => stryMutAct_9fa48("6") ? conv.label !== location.conversationLabel : stryMutAct_9fa48("5") ? false : stryMutAct_9fa48("4") ? true : (stryCov_9fa48("4", "5", "6"), conv.label === location.conversationLabel)));159 const prevConversation = player.activeConversationArea;160 player.location = location;161 player.activeConversationArea = conversation;162 if (stryMutAct_9fa48("9") ? conversation === prevConversation : stryMutAct_9fa48("8") ? false : stryMutAct_9fa48("7") ? true : (stryCov_9fa48("7", "8", "9"), conversation !== prevConversation)) {163 if (stryMutAct_9fa48("10")) {164 {}165 } else {166 stryCov_9fa48("10");167 if (stryMutAct_9fa48("12") ? false : stryMutAct_9fa48("11") ? true : (stryCov_9fa48("11", "12"), prevConversation)) {168 if (stryMutAct_9fa48("13")) {169 {}170 } else {171 stryCov_9fa48("13");172 this.removePlayerFromConversationArea(player, prevConversation);173 }174 }175 if (stryMutAct_9fa48("15") ? false : stryMutAct_9fa48("14") ? true : (stryCov_9fa48("14", "15"), conversation)) {176 if (stryMutAct_9fa48("16")) {177 {}178 } else {179 stryCov_9fa48("16");180 conversation.occupantsByID.push(player.id);181 this._listeners.forEach(stryMutAct_9fa48("17") ? () => undefined : (stryCov_9fa48("17"), listener => listener.onConversationAreaUpdated(conversation)));182 }183 }184 }185 }186 this._listeners.forEach(stryMutAct_9fa48("18") ? () => undefined : (stryCov_9fa48("18"), listener => listener.onPlayerMoved(player)));187 }188 /**189 * Removes a player from a conversation area, updating the conversation area's occupants list, 190 * and emitting the appropriate message (area updated or area destroyed)191 * 192 * Does not update the player's activeConversationArea property.193 * 194 * @param player Player to remove from conversation area195 * @param conversation Conversation area to remove player from196 */197 removePlayerFromConversationArea(player: Player, conversation: ServerConversationArea): void {198 conversation.occupantsByID.splice(conversation.occupantsByID.findIndex(stryMutAct_9fa48("19") ? () => undefined : (stryCov_9fa48("19"), p => stryMutAct_9fa48("22") ? p !== player.id : stryMutAct_9fa48("21") ? false : stryMutAct_9fa48("20") ? true : (stryCov_9fa48("20", "21", "22"), p === player.id))), 1);199 if (stryMutAct_9fa48("25") ? conversation.occupantsByID.length !== 0 : stryMutAct_9fa48("24") ? false : stryMutAct_9fa48("23") ? true : (stryCov_9fa48("23", "24", "25"), conversation.occupantsByID.length === 0)) {200 if (stryMutAct_9fa48("26")) {201 {}202 } else {203 stryCov_9fa48("26");204 this._conversationAreas.splice(this._conversationAreas.findIndex(stryMutAct_9fa48("27") ? () => undefined : (stryCov_9fa48("27"), conv => stryMutAct_9fa48("30") ? conv !== conversation : stryMutAct_9fa48("29") ? false : stryMutAct_9fa48("28") ? true : (stryCov_9fa48("28", "29", "30"), conv === conversation))), 1);205 this._listeners.forEach(stryMutAct_9fa48("31") ? () => undefined : (stryCov_9fa48("31"), listener => listener.onConversationAreaDestroyed(conversation)));206 }207 } else {208 if (stryMutAct_9fa48("32")) {209 {}210 } else {211 stryCov_9fa48("32");212 this._listeners.forEach(stryMutAct_9fa48("33") ? () => undefined : (stryCov_9fa48("33"), listener => listener.onConversationAreaUpdated(conversation)));213 }214 }215 }216 /**217 * Creates a new conversation area in this town if there is not currently an active218 * conversation with the same label.219 *220 * Adds any players who are in the region defined by the conversation area to it.221 *222 * Notifies any CoveyTownListeners that the conversation has been updated223 *224 * @param _conversationArea Information describing the conversation area to create. Ignores any225 * occupantsById that are set on the conversation area that is passed to this method.226 *227 * @returns true if the conversation is successfully created, or false if not228 */229 addConversationArea(_conversationArea: ServerConversationArea): boolean {230 if (stryMutAct_9fa48("34")) {231 {}232 } else {233 stryCov_9fa48("34");234 if (stryMutAct_9fa48("36") ? false : stryMutAct_9fa48("35") ? true : (stryCov_9fa48("35", "36"), this._conversationAreas.find(stryMutAct_9fa48("37") ? () => undefined : (stryCov_9fa48("37"), eachExistingConversation => stryMutAct_9fa48("40") ? eachExistingConversation.label !== _conversationArea.label : stryMutAct_9fa48("39") ? false : stryMutAct_9fa48("38") ? true : (stryCov_9fa48("38", "39", "40"), eachExistingConversation.label === _conversationArea.label))))) return stryMutAct_9fa48("41") ? true : (stryCov_9fa48("41"), false);235 if (stryMutAct_9fa48("44") ? _conversationArea.topic !== '' : stryMutAct_9fa48("43") ? false : stryMutAct_9fa48("42") ? true : (stryCov_9fa48("42", "43", "44"), _conversationArea.topic === (stryMutAct_9fa48("45") ? "Stryker was here!" : (stryCov_9fa48("45"), '')))) {236 if (stryMutAct_9fa48("46")) {237 {}238 } else {239 stryCov_9fa48("46");240 return stryMutAct_9fa48("47") ? true : (stryCov_9fa48("47"), false);241 }242 }243 if (stryMutAct_9fa48("50") ? this._conversationAreas.find(eachExistingConversation => CoveyTownController.boxesOverlap(eachExistingConversation.boundingBox, _conversationArea.boundingBox)) === undefined : stryMutAct_9fa48("49") ? false : stryMutAct_9fa48("48") ? true : (stryCov_9fa48("48", "49", "50"), this._conversationAreas.find(stryMutAct_9fa48("51") ? () => undefined : (stryCov_9fa48("51"), eachExistingConversation => CoveyTownController.boxesOverlap(eachExistingConversation.boundingBox, _conversationArea.boundingBox))) !== undefined)) {244 if (stryMutAct_9fa48("52")) {245 {}246 } else {247 stryCov_9fa48("52");248 return stryMutAct_9fa48("53") ? true : (stryCov_9fa48("53"), false);249 }250 }251 const newArea: ServerConversationArea = Object.assign(_conversationArea);252 this._conversationAreas.push(newArea);253 const playersInThisConversation = this.players.filter(stryMutAct_9fa48("54") ? () => undefined : (stryCov_9fa48("54"), player => player.isWithin(newArea)));254 playersInThisConversation.forEach(player => {255 if (stryMutAct_9fa48("55")) {256 {}257 } else {258 stryCov_9fa48("55");259 player.activeConversationArea = newArea;260 }261 });262 newArea.occupantsByID = playersInThisConversation.map(stryMutAct_9fa48("56") ? () => undefined : (stryCov_9fa48("56"), player => player.id));263 this._listeners.forEach(stryMutAct_9fa48("57") ? () => undefined : (stryCov_9fa48("57"), listener => listener.onConversationAreaUpdated(newArea)));264 return stryMutAct_9fa48("58") ? false : (stryCov_9fa48("58"), true);265 }266 }267 /**268 * Detects whether two bounding boxes overlap and share any points269 * 270 * @param box1 271 * @param box2 272 * @returns true if the boxes overlap, otherwise false273 */274 static boxesOverlap(box1: BoundingBox, box2: BoundingBox): boolean {275 // Helper function to extract the top left (x1,y1) and bottom right corner (x2,y2) of each bounding box276 const toRectPoints = stryMutAct_9fa48("59") ? () => undefined : (stryCov_9fa48("59"), (() => {277 const toRectPoints = (box: BoundingBox) => stryMutAct_9fa48("60") ? {} : (stryCov_9fa48("60"), {278 x1: stryMutAct_9fa48("61") ? box.x + box.width / 2 : (stryCov_9fa48("61"), box.x - (stryMutAct_9fa48("62") ? box.width * 2 : (stryCov_9fa48("62"), box.width / 2))),279 x2: stryMutAct_9fa48("63") ? box.x - box.width / 2 : (stryCov_9fa48("63"), box.x + (stryMutAct_9fa48("64") ? box.width * 2 : (stryCov_9fa48("64"), box.width / 2))),280 y1: stryMutAct_9fa48("65") ? box.y + box.height / 2 : (stryCov_9fa48("65"), box.y - (stryMutAct_9fa48("66") ? box.height * 2 : (stryCov_9fa48("66"), box.height / 2))),281 y2: stryMutAct_9fa48("67") ? box.y - box.height / 2 : (stryCov_9fa48("67"), box.y + (stryMutAct_9fa48("68") ? box.height * 2 : (stryCov_9fa48("68"), box.height / 2)))282 });283 return toRectPoints;284 })());285 const rect1 = toRectPoints(box1);286 const rect2 = toRectPoints(box2);287 const noOverlap = stryMutAct_9fa48("71") ? (rect1.x1 >= rect2.x2 || rect2.x1 >= rect1.x2 || rect1.y1 >= rect2.y2) && rect2.y1 >= rect1.y2 : stryMutAct_9fa48("70") ? false : stryMutAct_9fa48("69") ? true : (stryCov_9fa48("69", "70", "71"), (stryMutAct_9fa48("73") ? (rect1.x1 >= rect2.x2 || rect2.x1 >= rect1.x2) && rect1.y1 >= rect2.y2 : stryMutAct_9fa48("72") ? false : (stryCov_9fa48("72", "73"), (stryMutAct_9fa48("75") ? rect1.x1 >= rect2.x2 && rect2.x1 >= rect1.x2 : stryMutAct_9fa48("74") ? false : (stryCov_9fa48("74", "75"), (stryMutAct_9fa48("78") ? rect1.x1 < rect2.x2 : stryMutAct_9fa48("77") ? rect1.x1 > rect2.x2 : stryMutAct_9fa48("76") ? false : (stryCov_9fa48("76", "77", "78"), rect1.x1 >= rect2.x2)) || (stryMutAct_9fa48("81") ? rect2.x1 < rect1.x2 : stryMutAct_9fa48("80") ? rect2.x1 > rect1.x2 : stryMutAct_9fa48("79") ? false : (stryCov_9fa48("79", "80", "81"), rect2.x1 >= rect1.x2)))) || (stryMutAct_9fa48("84") ? rect1.y1 < rect2.y2 : stryMutAct_9fa48("83") ? rect1.y1 > rect2.y2 : stryMutAct_9fa48("82") ? false : (stryCov_9fa48("82", "83", "84"), rect1.y1 >= rect2.y2)))) || (stryMutAct_9fa48("87") ? rect2.y1 < rect1.y2 : stryMutAct_9fa48("86") ? rect2.y1 > rect1.y2 : stryMutAct_9fa48("85") ? false : (stryCov_9fa48("85", "86", "87"), rect2.y1 >= rect1.y2)));288 return stryMutAct_9fa48("88") ? noOverlap : (stryCov_9fa48("88"), !noOverlap);289 }290 /**291 * Subscribe to events from this town. Callers should make sure to292 * unsubscribe when they no longer want those events by calling removeTownListener293 *294 * @param listener New listener295 */296 addTownListener(listener: CoveyTownListener): void {297 this._listeners.push(listener);298 }299 /**300 * Unsubscribe from events in this town.301 *302 * @param listener The listener to unsubscribe, must be a listener that was registered...

Full Screen

Full Screen

tsconfig-helpers.ts

Source:tsconfig-helpers.ts Github

copy

Full Screen

...30 }31 stryCov_9fa48 = cover;32 cover.apply(null, arguments);33}34function stryMutAct_9fa48(id) {35 var ns = stryNS_9fa48();36 function isActive(id) {37 if (ns.activeMutant === id) {38 if (ns.hitCount !== void 0 && ++ns.hitCount > ns.hitLimit) {39 throw new Error('Stryker: Hit count limit reached (' + ns.hitCount + ')');40 }41 return true;42 }43 return false;44 }45 stryMutAct_9fa48 = isActive;46 return isActive(id);47}48import path from 'path';49import ts from 'typescript';50import semver from 'semver'; // Override some compiler options that have to do with code quality. When mutating, we're not interested in the resulting code quality51// See https://github.com/stryker-mutator/stryker-js/issues/391 for more info52const COMPILER_OPTIONS_OVERRIDES: Readonly<Partial<ts.CompilerOptions>> = Object.freeze(stryMutAct_9fa48("20") ? {} : (stryCov_9fa48("20"), {53 allowUnreachableCode: stryMutAct_9fa48("21") ? false : (stryCov_9fa48("21"), true),54 noUnusedLocals: stryMutAct_9fa48("22") ? true : (stryCov_9fa48("22"), false),55 noUnusedParameters: stryMutAct_9fa48("23") ? true : (stryCov_9fa48("23"), false)56})); // When we're running in 'single-project' mode, we can safely disable emit57const NO_EMIT_OPTIONS_FOR_SINGLE_PROJECT: Readonly<Partial<ts.CompilerOptions>> = Object.freeze(stryMutAct_9fa48("24") ? {} : (stryCov_9fa48("24"), {58 noEmit: stryMutAct_9fa48("25") ? false : (stryCov_9fa48("25"), true),59 incremental: stryMutAct_9fa48("26") ? true : (stryCov_9fa48("26"), false),60 // incremental and composite off: https://github.com/microsoft/TypeScript/issues/3691761 composite: stryMutAct_9fa48("27") ? true : (stryCov_9fa48("27"), false),62 declaration: stryMutAct_9fa48("28") ? true : (stryCov_9fa48("28"), false)63})); // When we're running in 'project references' mode, we need to enable declaration output64const LOW_EMIT_OPTIONS_FOR_PROJECT_REFERENCES: Readonly<Partial<ts.CompilerOptions>> = Object.freeze(stryMutAct_9fa48("29") ? {} : (stryCov_9fa48("29"), {65 emitDeclarationOnly: stryMutAct_9fa48("30") ? false : (stryCov_9fa48("30"), true),66 noEmit: stryMutAct_9fa48("31") ? true : (stryCov_9fa48("31"), false),67 declarationMap: stryMutAct_9fa48("32") ? true : (stryCov_9fa48("32"), false)68}));69export function guardTSVersion(): void {70 if (stryMutAct_9fa48("33")) {71 {}72 } else {73 stryCov_9fa48("33");74 if (stryMutAct_9fa48("36") ? false : stryMutAct_9fa48("35") ? true : stryMutAct_9fa48("34") ? semver.satisfies(ts.version, '>=3.6') : (stryCov_9fa48("34", "35", "36"), !semver.satisfies(ts.version, stryMutAct_9fa48("37") ? "" : (stryCov_9fa48("37"), '>=3.6')))) {75 if (stryMutAct_9fa48("38")) {76 {}77 } else {78 stryCov_9fa48("38");79 throw new Error(stryMutAct_9fa48("39") ? `` : (stryCov_9fa48("39"), `@stryker-mutator/typescript-checker only supports typescript@3.6 our higher. Found typescript@${ts.version}`));80 }81 }82 }83}84/**85 * Determines whether or not to use `--build` mode based on "references" being there in the config file86 * @param tsconfigFileName The tsconfig file to parse87 */88export function determineBuildModeEnabled(tsconfigFileName: string): boolean {89 if (stryMutAct_9fa48("40")) {90 {}91 } else {92 stryCov_9fa48("40");93 const tsconfigFile = ts.sys.readFile(tsconfigFileName);94 if (stryMutAct_9fa48("43") ? false : stryMutAct_9fa48("42") ? true : stryMutAct_9fa48("41") ? tsconfigFile : (stryCov_9fa48("41", "42", "43"), !tsconfigFile)) {95 if (stryMutAct_9fa48("44")) {96 {}97 } else {98 stryCov_9fa48("44");99 throw new Error(stryMutAct_9fa48("45") ? `` : (stryCov_9fa48("45"), `File "${tsconfigFileName}" not found!`));100 }101 }102 const useProjectReferences = ((stryMutAct_9fa48("46") ? "" : (stryCov_9fa48("46"), 'references')) in ts.parseConfigFileTextToJson(tsconfigFileName, tsconfigFile).config);103 return useProjectReferences;104 }105}106/**107 * Overrides some options to speed up compilation and disable some code quality checks we don't want during mutation testing108 * @param parsedConfig The parsed config file109 * @param useBuildMode whether or not `--build` mode is used110 */111export function overrideOptions(parsedConfig: {112 config?: any;113}, useBuildMode: boolean): string {114 if (stryMutAct_9fa48("47")) {115 {}116 } else {117 stryCov_9fa48("47");118 const config = stryMutAct_9fa48("48") ? {} : (stryCov_9fa48("48"), { ...parsedConfig.config,119 compilerOptions: stryMutAct_9fa48("49") ? {} : (stryCov_9fa48("49"), { ...(stryMutAct_9fa48("50") ? parsedConfig.config.compilerOptions : (stryCov_9fa48("50"), parsedConfig.config?.compilerOptions)),120 ...COMPILER_OPTIONS_OVERRIDES,121 ...(useBuildMode ? LOW_EMIT_OPTIONS_FOR_PROJECT_REFERENCES : NO_EMIT_OPTIONS_FOR_SINGLE_PROJECT)122 })123 });124 return JSON.stringify(config);125 }126}127/**128 * Retrieves the referenced config files based on parsed configuration129 * @param parsedConfig The parsed config file130 * @param fromDirName The directory where to resolve from131 */132export function retrieveReferencedProjects(parsedConfig: {133 config?: any;134}, fromDirName: string): string[] {135 if (stryMutAct_9fa48("51")) {136 {}137 } else {138 stryCov_9fa48("51");139 if (stryMutAct_9fa48("53") ? false : stryMutAct_9fa48("52") ? true : (stryCov_9fa48("52", "53"), Array.isArray(stryMutAct_9fa48("54") ? parsedConfig.config.references : (stryCov_9fa48("54"), parsedConfig.config?.references)))) {140 if (stryMutAct_9fa48("55")) {141 {}142 } else {143 stryCov_9fa48("55");144 return stryMutAct_9fa48("56") ? parsedConfig.config.references.map((reference: ts.ProjectReference) => path.resolve(fromDirName, ts.resolveProjectReferencePath(reference))) : (stryCov_9fa48("56"), parsedConfig.config?.references.map(stryMutAct_9fa48("57") ? () => undefined : (stryCov_9fa48("57"), (reference: ts.ProjectReference) => path.resolve(fromDirName, ts.resolveProjectReferencePath(reference)))));145 }146 }147 return stryMutAct_9fa48("58") ? ["Stryker was here"] : (stryCov_9fa48("58"), []);148 }149}150/**151 * Replaces backslashes with forward slashes (used by typescript)152 * @param fileName The file name that may contain backslashes `\`153 * @returns posix and ts complaint file name (with `/`)154 */155export function toPosixFileName(fileName: string): string {156 if (stryMutAct_9fa48("59")) {157 {}158 } else {159 stryCov_9fa48("59");160 return fileName.replace(/\\/g, stryMutAct_9fa48("60") ? "" : (stryCov_9fa48("60"), '/'));161 }...

Full Screen

Full Screen

Player.ts

Source:Player.ts Github

copy

Full Screen

...30 }31 stryCov_9fa48 = cover;32 cover.apply(null, arguments);33}34function stryMutAct_9fa48(id) {35 var ns = stryNS_9fa48();36 function isActive(id) {37 if (ns.activeMutant === id) {38 if (ns.hitCount !== void 0 && ++ns.hitCount > ns.hitLimit) {39 throw new Error('Stryker: Hit count limit reached (' + ns.hitCount + ')');40 }41 return true;42 }43 return false;44 }45 stryMutAct_9fa48 = isActive;46 return isActive(id);47}48import { nanoid } from 'nanoid';49import { ServerConversationArea } from '../client/TownsServiceClient';50import { UserLocation } from '../CoveyTypes';51/**52 * Each user who is connected to a town is represented by a Player object53 */54export default class Player {55 /** The current location of this user in the world map * */56 public location: UserLocation;57 /** The unique identifier for this player * */58 private readonly _id: string;59 /** The player's username, which is not guaranteed to be unique within the town * */60 private readonly _userName: string;61 /** The current ConversationArea that the player is in, or undefined if they are not located within one */62 private _activeConversationArea?: ServerConversationArea;63 constructor(userName: string) {64 this.location = {65 x: 0,66 y: 0,67 moving: false,68 rotation: 'front'69 };70 this._userName = userName;71 this._id = nanoid();72 }73 get userName(): string {74 return this._userName;75 }76 get id(): string {77 return this._id;78 }79 get activeConversationArea(): ServerConversationArea | undefined {80 return this._activeConversationArea;81 }82 set activeConversationArea(conversationArea: ServerConversationArea | undefined) {83 this._activeConversationArea = conversationArea;84 }85 /**86 * Checks to see if a player's location is within the specified conversation area87 * 88 * This method is resilient to floating point errors that could arise if any of the coordinates of89 * `this.location` are dramatically smaller than those of the conversation area's bounding box.90 * @param conversation 91 * @returns 92 */93 isWithin(conversation: ServerConversationArea): boolean {94 if (stryMutAct_9fa48("106")) {95 {}96 } else {97 stryCov_9fa48("106");98 return stryMutAct_9fa48("109") ? this.location.x > conversation.boundingBox.x - conversation.boundingBox.width / 2 && this.location.x < conversation.boundingBox.x + conversation.boundingBox.width / 2 && this.location.y > conversation.boundingBox.y - conversation.boundingBox.height / 2 || this.location.y < conversation.boundingBox.y + conversation.boundingBox.height / 2 : stryMutAct_9fa48("108") ? false : stryMutAct_9fa48("107") ? true : (stryCov_9fa48("107", "108", "109"), (stryMutAct_9fa48("111") ? this.location.x > conversation.boundingBox.x - conversation.boundingBox.width / 2 && this.location.x < conversation.boundingBox.x + conversation.boundingBox.width / 2 || this.location.y > conversation.boundingBox.y - conversation.boundingBox.height / 2 : stryMutAct_9fa48("110") ? true : (stryCov_9fa48("110", "111"), (stryMutAct_9fa48("113") ? this.location.x > conversation.boundingBox.x - conversation.boundingBox.width / 2 || this.location.x < conversation.boundingBox.x + conversation.boundingBox.width / 2 : stryMutAct_9fa48("112") ? true : (stryCov_9fa48("112", "113"), (stryMutAct_9fa48("116") ? this.location.x <= conversation.boundingBox.x - conversation.boundingBox.width / 2 : stryMutAct_9fa48("115") ? this.location.x >= conversation.boundingBox.x - conversation.boundingBox.width / 2 : stryMutAct_9fa48("114") ? true : (stryCov_9fa48("114", "115", "116"), this.location.x > (stryMutAct_9fa48("117") ? conversation.boundingBox.x + conversation.boundingBox.width / 2 : (stryCov_9fa48("117"), conversation.boundingBox.x - (stryMutAct_9fa48("118") ? conversation.boundingBox.width * 2 : (stryCov_9fa48("118"), conversation.boundingBox.width / 2)))))) && (stryMutAct_9fa48("121") ? this.location.x >= conversation.boundingBox.x + conversation.boundingBox.width / 2 : stryMutAct_9fa48("120") ? this.location.x <= conversation.boundingBox.x + conversation.boundingBox.width / 2 : stryMutAct_9fa48("119") ? true : (stryCov_9fa48("119", "120", "121"), this.location.x < (stryMutAct_9fa48("122") ? conversation.boundingBox.x - conversation.boundingBox.width / 2 : (stryCov_9fa48("122"), conversation.boundingBox.x + (stryMutAct_9fa48("123") ? conversation.boundingBox.width * 2 : (stryCov_9fa48("123"), conversation.boundingBox.width / 2)))))))) && (stryMutAct_9fa48("126") ? this.location.y <= conversation.boundingBox.y - conversation.boundingBox.height / 2 : stryMutAct_9fa48("125") ? this.location.y >= conversation.boundingBox.y - conversation.boundingBox.height / 2 : stryMutAct_9fa48("124") ? true : (stryCov_9fa48("124", "125", "126"), this.location.y > (stryMutAct_9fa48("127") ? conversation.boundingBox.y + conversation.boundingBox.height / 2 : (stryCov_9fa48("127"), conversation.boundingBox.y - (stryMutAct_9fa48("128") ? conversation.boundingBox.height * 2 : (stryCov_9fa48("128"), conversation.boundingBox.height / 2)))))))) && (stryMutAct_9fa48("131") ? this.location.y >= conversation.boundingBox.y + conversation.boundingBox.height / 2 : stryMutAct_9fa48("130") ? this.location.y <= conversation.boundingBox.y + conversation.boundingBox.height / 2 : stryMutAct_9fa48("129") ? true : (stryCov_9fa48("129", "130", "131"), this.location.y < (stryMutAct_9fa48("132") ? conversation.boundingBox.y - conversation.boundingBox.height / 2 : (stryCov_9fa48("132"), conversation.boundingBox.y + (stryMutAct_9fa48("133") ? conversation.boundingBox.height * 2 : (stryCov_9fa48("133"), conversation.boundingBox.height / 2)))))));99 }100 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;2var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;3var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;4var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;5var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;6var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;7var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;8var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;9var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;10var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;11var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;12var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryker = require('stryker-parent');2var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;3var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;4var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;5var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;6var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;7var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;8var stryker = require('stryker-parent');9var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;10var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;11var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;12var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;13var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;14var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;15var stryker = require('stryker-parent');16var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;17var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;18var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;19var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;20var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;21var stryMutAct_9fa48 = stryker.stryMutAct_9fa48;22var stryker = require('stryker-parent');

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryMutAct_9fa48 = require('stryker-parent')['stryMutAct_9fa48'];2stryMutAct_9fa48('9fa48');3module.exports = {4 stryMutAct_9fa48: function(stryCovId) {5 }6};

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;2stryMutAct_9fa48('9fa48');3var stryMutAct_9fa48 = require('stryker-child').stryMutAct_9fa48;4stryMutAct_9fa48('9fa48');5var stryMutAct_9fa48 = function(stryCovId) {6};7module.exports = {8};9var stryMutAct_9fa48 = function(stryCovId) {10};11module.exports = {12};

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryMutAct_9fa48 = require('stryker-parent')['stryMutAct_9fa48']; 2stryMutAct_9fa48('test');3module.exports = {4 stryMutAct_9fa48: function (name) {5 console.log('Hello ' + name);6 }7};8module.exports = {9 stryMutAct_9fa48: function (name) {10 console.warn('Hello ' + name);11 }12};13module.exports = {14 stryMutAct_9fa48: function (name) {15 console.log('Hello ' + name);16 }17};18module.exports = {19 stryMutAct_9fa48: function (name) {20 console.log('Hello ' + name);21 }22};23module.exports = {24 stryMutAct_9fa48: function (name) {25 console.log('Hello ' + name);26 }27};28module.exports = {29 stryMutAct_9fa48: function (name) {30 console.log('

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryMutAct_9fa48 = require('stryker-parent').stryMutAct_9fa48;2var foo = 'bar';3var bar = 'baz';4var baz = 'foo';5console.log(foo);6console.log(bar);7console.log(baz);8var stryMutAct_9fa48 = require('stryker-child').stryMutAct_9fa48;9var foo = 'bar';10var bar = 'baz';11var baz = 'foo';12console.log(foo);13console.log(bar);14console.log(baz);15The following code uses the require() function to load the http module:16var http = require('http');17console.log(http);18{ Server: [Function: Server],

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful