/*---------------------------------------------------------------------------* Project: Horizon File: AgeChecker.cpp Copyright (C)2014 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev$ *---------------------------------------------------------------------------*/ #include "AgeChecker.h" using namespace nn::cfg::CTR; namespace ConsoleRestore { const u32 PIN_REQUIRED_AGE_IN_AUSTRALIA_AND_NEW_ZEALAND = 18; const u32 PIN_REQUIRED_AGE_IN_EUROPE = 13; const u32 PIN_REQUIRED_AGE_IN_UNITED_STATES_AND_CANADA = 13; const u32 COPPA_REQUIRED_AGE = 13; AgeChecker::AgeChecker() { // TODO 自動生成されたコンストラクター・スタブ } AgeChecker::~AgeChecker() { // TODO Auto-generated destructor stub } bool AgeChecker::IsPinRestrictionRequired(u32 age, CfgRegionCode region, CfgCountryCode country) { if (region == CFG_REGION_EUROPE) { switch (country) { case CFG_COUNTRY_AUSTRALIA: case CFG_COUNTRY_NEW_ZEALAND: { return age < PIN_REQUIRED_AGE_IN_AUSTRALIA_AND_NEW_ZEALAND; } default: { return age < PIN_REQUIRED_AGE_IN_EUROPE; } } } else if (region == CFG_REGION_AMERICA && (country == CFG_COUNTRY_UNITED_STATES || country == CFG_COUNTRY_CANADA)) { return age < PIN_REQUIRED_AGE_IN_UNITED_STATES_AND_CANADA; } return false; } bool AgeChecker::IsCoppaRequired(u32 age, nn::cfg::CTR::CfgRegionCode region, nn::cfg::CTR::CfgCountryCode country) { if ((region == CFG_REGION_AMERICA && country == CFG_COUNTRY_UNITED_STATES && age < COPPA_REQUIRED_AGE) || (region == CFG_REGION_AMERICA && country == CFG_COUNTRY_CANADA && age < COPPA_REQUIRED_AGE)) { return true; } else { return false; } } } /* namespace ConsoleRestore */