mirror of
https://github.com/kevinveenbirkenbach/roulette-wheel.git
synced 2025-09-10 12:17:16 +02:00
light and darkmode change logic & disable buttons after start spin & format
This commit is contained in:
@@ -2,31 +2,30 @@ import { Item } from "./item";
|
||||
import { List } from "./list";
|
||||
|
||||
export class ItemList implements List<Item> {
|
||||
items: Item[];
|
||||
maximumSize: number;
|
||||
items: Item[];
|
||||
maximumSize: number;
|
||||
|
||||
constructor(maxSize: number){
|
||||
this.items = [];
|
||||
this.maximumSize = maxSize;
|
||||
}
|
||||
constructor(maxSize: number) {
|
||||
this.items = [];
|
||||
this.maximumSize = maxSize;
|
||||
}
|
||||
|
||||
add(item: Item){
|
||||
if(this.items.length < this.maximumSize)
|
||||
this.items.push(item);
|
||||
}
|
||||
add(item: Item) {
|
||||
if (this.items.length < this.maximumSize) this.items.push(item);
|
||||
}
|
||||
|
||||
removeById(id: number){
|
||||
const toRemove = this.items.find(e => e.id === id);
|
||||
if(toRemove){
|
||||
this.remove(toRemove);
|
||||
}
|
||||
removeById(id: number) {
|
||||
const toRemove = this.items.find((e) => e.id === id);
|
||||
if (toRemove) {
|
||||
this.remove(toRemove);
|
||||
}
|
||||
}
|
||||
|
||||
remove(item: Item){
|
||||
this.items.splice(this.items.indexOf(item), 1);
|
||||
}
|
||||
remove(item: Item) {
|
||||
this.items.splice(this.items.indexOf(item), 1);
|
||||
}
|
||||
|
||||
clear(){
|
||||
this.items = [];
|
||||
}
|
||||
}
|
||||
clear() {
|
||||
this.items = [];
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
export interface List<T> {
|
||||
items: T[];
|
||||
|
||||
add(item: T): void;
|
||||
}
|
||||
items: T[];
|
||||
|
||||
add(item: T): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user