Skip to content

Commit

Permalink
reverting changes to package-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
rlszabo committed Apr 19, 2023
1 parent 70a75b0 commit 8a1968d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
23 changes: 14 additions & 9 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { randomName } from '../common/names';
import * as localize from '../common/localize';
import { availableColors, normalizeColor } from '../panel/pets';


const EXTRA_PETS_KEY = 'vscode-pets.extra-pets';
const EXTRA_PETS_KEY_TYPES = EXTRA_PETS_KEY + '.types';
const EXTRA_PETS_KEY_COLORS = EXTRA_PETS_KEY + '.colors';
Expand All @@ -38,7 +37,6 @@ class PetQuickPickItem implements vscode.QuickPickItem {
this.label = name_;
this.description = `${color} ${type}`;
this.petId = petId;

}

name: string;
Expand Down Expand Up @@ -114,7 +112,7 @@ export class PetSpecification {
this.color = color;
this.type = type;
this.size = size;

if (!name) {
this.name = randomName(type);
} else {
Expand Down Expand Up @@ -209,14 +207,13 @@ async function handleRemovePetMessage(
var petList: IPetInfo[] = Array();
switch (message.command) {
case 'list-pets':

message.text.split('\n').forEach((pet) => {
var parts = pet.split(',');
petList.push({
type: parts[0] as PetType,
name: parts[1],
color: parts[2] as PetColor,
petId: Number(parts[3])
petId: Number(parts[3]),
});
});
break;
Expand All @@ -229,7 +226,12 @@ async function handleRemovePetMessage(
await vscode.window
.showQuickPick<PetQuickPickItem>(
petList.map((val) => {
return new PetQuickPickItem(val.name, val.type, val.color, val.petId);
return new PetQuickPickItem(
val.name,
val.type,
val.color,
val.petId,
);
}),
{
placeHolder: vscode.l10n.t('Select the pet to remove.'),
Expand Down Expand Up @@ -799,7 +801,7 @@ class PetWebviewContainer implements IPetPanel {
this.getWebview().postMessage({
command: 'delete-pet',
name: petName,
petId: petId
petId: petId,
});
}

Expand Down Expand Up @@ -978,8 +980,11 @@ class PetPanel extends PetWebviewContainer implements IPetPanel {
}

public deletePet(petName: string, petId: number): void {
this.getWebview().postMessage({ command: 'delete-pet', name: petName, petId: petId});

this.getWebview().postMessage({
command: 'delete-pet',
name: petName,
petId: petId,
});
}

public static revive(
Expand Down
4 changes: 2 additions & 2 deletions src/panel/basepettype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export abstract class BasePetType implements IPetType {
this._size = size;
this._speed = this.randomizeSpeed(speed);

//increment petId: unique identifier for all pets
//increment petId: unique identifier for all pets
this.petId = ++BasePetType.idMaker;

// Increment the static count of the Pet class that the constructor belongs to
(this.constructor as any).count += 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/panel/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ export function petPanelApp(
command: 'list-pets',
text: pets
.map(
(pet) => `${pet.type},${pet.pet.name},${pet.color},${pet.pet.petId}`,
(pet) =>
`${pet.type},${pet.pet.name},${pet.color},${pet.pet.petId}`,
)
.join('\n'),
});
Expand Down
2 changes: 0 additions & 2 deletions src/panel/pets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class PetElement {
pet: IPetType,
color: PetColor,
type: PetType,

) {
this.el = el;
this.collision = collision;
Expand Down Expand Up @@ -89,7 +88,6 @@ export class PetCollection implements IPetCollection {

remove(id: number): any {
this._pets.forEach((pet) => {

if (pet.pet.petId === id) {
pet.remove();
}
Expand Down

0 comments on commit 8a1968d

Please sign in to comment.