Skip to content

Commit

Permalink
Add Multicultural character set. See #198.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Dec 7, 2023
1 parent 2f7bcf8 commit d42dbcd
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arithmetic_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"africaModest",
"asia",
"latinAmerica",
"oceania"
"oceania",
"multi"
]
},
"simulation": true,
Expand Down
48 changes: 48 additions & 0 deletions js/common/view/BoxPlayerCharacterSetMulticultural.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2023, University of Colorado Boulder

/**
* This file instantiates randomly chosen region and culture portrayals for each screen.
*
* @author Luisa Vargas
*
*/

import dotRandom from '../../../../dot/js/dotRandom.js';
import JoistStrings from '../../../../joist/js/JoistStrings.js';
import { MULTICULTURAL_REGION_AND_CULTURE_ID } from '../../../../joist/js/preferences/RegionAndCulturePortrayal.js';
import BoxPlayerCharacterSet from './BoxPlayerCharacterSet.js';
import BoxPlayerCharacterSetAfrica from './BoxPlayerCharacterSetAfrica.js';
import BoxPlayerCharacterSetAfricaModest from './BoxPlayerCharacterSetAfricaModest.js';
import BoxPlayerCharacterSetAsia from './BoxPlayerCharacterSetAsia.js';
import BoxPlayerCharacterSetLatinAmerica from './BoxPlayerCharacterSetLatinAmerica.js';
import BoxPlayerCharacterSetOceania from './BoxPlayerCharacterSetOceania.js';
import BoxPlayerCharacterSetUSA from './BoxPlayerCharacterSetUSA.js';


const CHARACTER_SETS = [
BoxPlayerCharacterSetUSA,
BoxPlayerCharacterSetAfrica,
BoxPlayerCharacterSetAfricaModest,
BoxPlayerCharacterSetAsia,
BoxPlayerCharacterSetLatinAmerica,
BoxPlayerCharacterSetOceania
];
const MULTIPLY_RANDOM_CHARACTER_SET = dotRandom.sample( CHARACTER_SETS );
const FACTOR_RANDOM_CHARACTER_SET = dotRandom.sample( CHARACTER_SETS.filter( set => set !== MULTIPLY_RANDOM_CHARACTER_SET ) );
const DIVIDE_RANDOM_CHARACTER_SET = dotRandom.sample( CHARACTER_SETS.filter( set => set !== FACTOR_RANDOM_CHARACTER_SET ) );

const BoxPlayerCharacterSetMulticultural = new BoxPlayerCharacterSet(
JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.multiculturalStringProperty,
MULTIPLY_RANDOM_CHARACTER_SET.multiplyLevel1,
MULTIPLY_RANDOM_CHARACTER_SET.multiplyLevel2,
MULTIPLY_RANDOM_CHARACTER_SET.multiplyLevel3,
FACTOR_RANDOM_CHARACTER_SET.factorLevel1,
FACTOR_RANDOM_CHARACTER_SET.factorLevel2,
FACTOR_RANDOM_CHARACTER_SET.factorLevel3,
DIVIDE_RANDOM_CHARACTER_SET.divideLevel1,
DIVIDE_RANDOM_CHARACTER_SET.divideLevel2,
DIVIDE_RANDOM_CHARACTER_SET.divideLevel3,
MULTICULTURAL_REGION_AND_CULTURE_ID
);

export default BoxPlayerCharacterSetMulticultural;
2 changes: 2 additions & 0 deletions js/common/view/BoxPlayerImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import BoxPlayerCharacterSetAfrica from './BoxPlayerCharacterSetAfrica.js';
import BoxPlayerCharacterSetAfricaModest from './BoxPlayerCharacterSetAfricaModest.js';
import BoxPlayerCharacterSetAsia from './BoxPlayerCharacterSetAsia.js';
import BoxPlayerCharacterSetLatinAmerica from './BoxPlayerCharacterSetLatinAmerica.js';
import BoxPlayerCharacterSetMulticultural from './BoxPlayerCharacterSetMulticultural.js';
import BoxPlayerCharacterSetOceania from './BoxPlayerCharacterSetOceania.js';
import BoxPlayerCharacterSetUSA from './BoxPlayerCharacterSetUSA.js';


const BoxPlayerImages = {
BOX_PLAYER_CHARACTER_SETS: [
BoxPlayerCharacterSetMulticultural,
BoxPlayerCharacterSetAfrica,
BoxPlayerCharacterSetAfricaModest,
BoxPlayerCharacterSetAsia,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"africaModest",
"asia",
"latinAmerica",
"oceania"
"oceania",
"multi"
],
"supportsDynamicLocale": true
},
Expand Down

0 comments on commit d42dbcd

Please sign in to comment.