// Конфігурація позицій
const positions = ["GK", "DEF", "MID", "ATT"];
function generatePlayer(clubId) {
const firstNames = ["Andriy", "Viktor", "Taras", "Oleksandr", "Mykhailo"];
const lastNames = ["Shevchenko", "Tsygankov", "Stepanenko", "Zinchenko", "Mudryk"];
return {
id: Math.random().toString(36).substr(2, 9),
clubId: clubId,
name: `${firstNames[Math.floor(Math.random() * firstNames.length)]} ${lastNames[Math.floor(Math.random() * lastNames.length)]}`,
position: positions[Math.floor(Math.random() * positions.length)],
age: Math.floor(Math.random() * (35 - 17 + 1)) + 17,
// Характеристики (1-20)
skills: {
speed: Math.floor(Math.random() * 20) + 1,
shooting: Math.floor(Math.random() * 20) + 1,
passing: Math.floor(Math.random() * 20) + 1,
defense: Math.floor(Math.random() * 20) + 1
},
form: 100, // Фізичний стан
marketValue: Math.floor(Math.random() * 1000000) + 50000 // Ціна
};
}
// Створимо початкову команду з 15 гравців
const myClubPlayers = [];
for(let i = 0; i < 15; i++) {
myClubPlayers.push(generatePlayer("club_1"));
}
console.log("Ваша команда:", myClubPlayers);
Коментарі
Дописати коментар