Skip to content

Commit

Permalink
Added missing Regions
Browse files Browse the repository at this point in the history
  • Loading branch information
D0L1K committed Sep 12, 2023
1 parent 1e3fc01 commit 3b87987
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Base/Definitions/IRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ interface IRegion

const ASIA = 'asia';

const SEA = 'sea';

/**
* Returns region list.
*
Expand Down
20 changes: 20 additions & 0 deletions src/Base/Definitions/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,22 @@ class Platform implements IPlatform
const OCEANIA = 'oc1';
const KOREA = 'kr';
const JAPAN = 'jp1';
const PHILIPPINES = 'ph2';
const SINGAPORE = 'sg2';
const TAIWAN = 'tw2';
const THAILAND = 'th2';
const VIETNAM = 'vn2';

const AMERICAS = 'americas';
const EUROPE = 'europe';
const ASIA = 'asia';
const SEA = 'sea';

public static $list = array(
IRegion::EUROPE => self::EUROPE,
IRegion::AMERICAS => self::AMERICAS,
IRegion::ASIA => self::ASIA,
IRegion::SEA => self::SEA,
Region::NORTH_AMERICA => self::NORTH_AMERICA,
Region::EUROPE_WEST => self::EUROPE_WEST,
Region::EUROPE_EAST => self::EUROPE_EAST,
Expand All @@ -64,12 +71,18 @@ class Platform implements IPlatform
Region::OCEANIA => self::OCEANIA,
Region::KOREA => self::KOREA,
Region::JAPAN => self::JAPAN,
Region::PHILIPPINES => self::PHILIPPINES,
Region::SINGAPORE => self::SINGAPORE,
Region::TAIWAN => self::TAIWAN,
Region::THAILAND => self::THAILAND,
Region::VIETNAM => self::VIETNAM,
);

public static $continentalRegions = [
self::AMERICAS,
self::EUROPE,
self::ASIA,
self::SEA,
];


Expand Down Expand Up @@ -117,6 +130,13 @@ public function getCorrespondingContinentRegion($region): string
case Platform::JAPAN:
return IRegion::ASIA;

case Platform::PHILIPPINES:
case Platform::SINGAPORE:
case Platform::TAIWAN:
case Platform::THAILAND:
case Platform::VIETNAM:
return IRegion::SEA;

default:
throw new GeneralException("Unable to convert '$region' platform ID to corresponding continent region.");
}
Expand Down
11 changes: 11 additions & 0 deletions src/Base/Definitions/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class Region implements IRegion
const OCEANIA = 'oce';
const KOREA = 'kr';
const JAPAN = 'jp';
const PHILIPPINES = 'ph';
const SINGAPORE = 'sg';
const TAIWAN = 'tw';
const THAILAND = 'th';
const VIETNAM = 'vn';

public static $list = array(
self::NORTH_AMERICA => self::NORTH_AMERICA,
Expand All @@ -60,6 +65,12 @@ class Region implements IRegion
self::KOREA => self::KOREA,
self::JAPAN => self::JAPAN,
self::AMERICAS => self::AMERICAS,
self::PHILIPPINES => self::PHILIPPINES,
self::SINGAPORE => self::SINGAPORE,
self::TAIWAN => self::TAIWAN,
self::THAILAND => self::THAILAND,
self::VIETNAM => self::VIETNAM,
self::SEA => self::SEA,
);


Expand Down

0 comments on commit 3b87987

Please sign in to comment.