비밀번호를 잊어버리셨나요?
조회 수 110 추천 수 0 댓글 0

단축키

Prev이전 문서

Next다음 문서

수정 삭제

단축키

Prev이전 문서

Next다음 문서

수정 삭제

class Team {

public name: string;

public city: string;

public point: number;

public manager: string;

public players: string[];

public tactics: 'normal' | 'experimental';

 

constructor(name: string, city: string) {

this.name = name;

this.city = city;

this.point = 0;

this.manager = '';

this.players = [];

this.tactics = 'normal';

}

}

 

abstract class League {

public fixture: Team[];

public numberOfTeams: number;

 

constructor(teamList: Team[]) {

this.fixture = teamList;

this.numberOfTeams = teamList.length;

}

 

protected rank() {

this.fixture.sort((a, b) => b.point - a.point);

}

 

public match(homeTeam: Team, awayTeam: Team) {

const result = Math.floor(Math.random() * 3);

 

if (result == 0) {

homeTeam.point += 3;

} else if (result == 1) {

awayTeam.point += 3;

} else {

homeTeam.point += 1;

awayTeam.point += 1;

}

 

this.rank();

}

 

abstract finalRound(): void;

}

 

class PremierLeague extends League {

finalRound() {

if (this.fixture[0].manager == 'Pep Guardiola' && this.fixture[0].tactics != 'experimental')

console.log('Treble!');

}

}

 

class LaLiga extends League {

finalRound() {

if ((this.fixture[0].name == 'Real Madrid' || 'Barcelona')

|| (this.fixture[0].name == 'Atletico Madrid' && this.fixture[0].tactics == 'experimental')) {

console.log(`${this.fixture[0].name} is the Champion!`);

} else throw Error('Not LaLiga!');

}

}

 

class SerieA extends League {

finalRound() {

const minjae = this.fixture[0].players.findIndex(player => player == 'Minjae Kim')

if (minjae != -1) this.fixture[0].players.splice(minjae, 1);

}

}

 

class Bundesliga extends League {

finalRound() {

if (this.fixture[0].name != 'Bayern Munich') {

console.log('Assist by Jaesung Lee!');

this.fixture[0].point -= 2;

this.rank();

}

}

}

 

class LigueUn extends League {

finalRound() {

if (this.fixture[0].manager == 'Christophe Galtier') {

console.log('Arrested!');

this.fixture[0].manager = 'Luis Enrique';

}

}

}

JPG 이미지 버튼들

0

List of Articles
번호 분류 제목 조회 수 추천 수 날짜
공지 공지 🔥커뮤니티 챔피언 포인트·메달 시스템 전격 오픈⚽️ 35 0 2025.05.15
574 축구잡담 [트랜스퍼마켓] 2005년생 축구선수 이적료 순위.jpg file 168 0 2023.07.07
573 축구잡담 후안미 산체스 : 이강인 1998년 이바가사 아후 최고재능 113 0 2023.07.07
572 축구잡담 [오피셜] 아탈란타, 미첼 바커 영입 100 0 2023.07.07
571 축구잡담 [공식 발표] 발렌시아 CF 2023-24 홈 킷 117 0 2023.07.07
570 축구잡담 왼쪽 풀백 누구 없나? 94 0 2023.07.07
569 축구잡담 함부르크 2023-24 홈 킷 공개 file 104 0 2023.07.07
568 축구잡담 죶스날 101 0 2023.07.07
567 축구잡담 톱 누구 데리고 올라나 97 0 2023.07.07
566 축구잡담 자카 25M이 에두테타시기 최고 이적료 아닌가? 97 0 2023.07.07
565 축구잡담 소쇼가 강등 피하려고 선수 다 파는구나 112 0 2023.07.07
» 축구잡담 [해축백일장] FiveBigLeagues.ts 110 0 2023.07.07
563 축구잡담 개집 라이스 오긴하냐? file 123 0 2023.07.07
562 축구잡담 샬케, 4부리그 팀 상대로 졸전....14초만에 실점 file 108 0 2023.07.07
561 축구잡담 구단주 미국인이면 다른 미국인들처럼 장사를 해라 110 0 2023.07.07
560 축구잡담 [오피셜] 로빈 코흐, 1시즌동안 아인트라흐트 프랑크푸르트로 임대 112 0 2023.07.07
559 축구잡담 로이스 주장직 내려놨네 111 0 2023.07.07
558 축구잡담 벤피카와 팬들의 디마리아 환영 행사 모습 105 0 2023.07.07
557 축구잡담 PSG나 뮌헨이나 2주뒤에 일본 가던데 115 0 2023.07.07
556 축구잡담 근데 탄코는 어떤유형의 선수임? 97 0 2023.07.07
555 축구잡담 첼시 스폰 닌텐도 다나보네 140 0 2023.07.07
554 축구잡담 알레띠팬들 시메오네 왜 싫어함 110 0 2023.07.07
553 축구잡담 자카를 결국 2500만유로에 팔았네 103 0 2023.07.07
552 축구잡담 아탈란타, 콜라시냐츠 영입 file 120 0 2023.07.07
551 축구잡담 맨유 매과이어 매각 어려운 이유 128 0 2023.07.07
550 축구잡담 아스널 7년→다시 독일로...前 주장 자카, 레버쿠젠 이적 5년 계약 126 0 2023.07.07
549 축구잡담 [공트] 셀틱 FC, 마에다 다이젠 재계약 94 0 2023.07.07
548 축구잡담 맨유 그린우드 프리시즌 불참 시즌 전 새 팀 결경 97 0 2023.07.07
547 축구잡담 인테르, 맨유의 '총 710억' 2번째 제안 단칼에 거절 93 0 2023.07.07
546 축구잡담 [오피셜] 레인저스 FC 시리얼 데셀스 영입 113 0 2023.07.07
545 축구잡담 [오피셜] 아인트라흐트 프랑크푸르트 로빈 코흐 임대 영입 103 0 2023.07.07
Board Pagination Prev 1 ... 16 17 18 19 20 21 22 23 24 25 ... 40 Next
/ 40