Add offset property to extra slots

This commit is contained in:
Justin Edmund 2022-01-14 21:23:13 -08:00
parent c809d4ebdc
commit db834aa04a
4 changed files with 9 additions and 5 deletions

View file

@ -16,6 +16,7 @@ interface Props {
editable: boolean editable: boolean
exists: boolean exists: boolean
found?: boolean found?: boolean
offset: number
onSelect: (type: GridType, summon: Summon, position: number) => void onSelect: (type: GridType, summon: Summon, position: number) => void
} }
@ -37,9 +38,9 @@ const ExtraSummons = (props: Props) => {
<SummonUnit <SummonUnit
editable={props.editable} editable={props.editable}
onReceiveData={receiveWeapon} onReceiveData={receiveWeapon}
position={i} position={props.offset + i}
unitType={1} unitType={1}
summon={props.grid[i]} summon={props.grid[props.offset + i]}
/> />
</li> </li>
) )

View file

@ -17,6 +17,7 @@ interface Props {
editable: boolean editable: boolean
exists: boolean exists: boolean
found?: boolean found?: boolean
offset: number
onSelect: (type: GridType, weapon: Weapon, position: number) => void onSelect: (type: GridType, weapon: Weapon, position: number) => void
} }
@ -38,9 +39,9 @@ const ExtraWeapons = (props: Props) => {
<WeaponUnit <WeaponUnit
editable={props.editable} editable={props.editable}
onReceiveData={receiveWeapon} onReceiveData={receiveWeapon}
position={i} position={props.offset + i}
unitType={1} unitType={1}
weapon={props.grid[i]} weapon={props.grid[props.offset + i]}
/> />
</li> </li>
) )

View file

@ -85,6 +85,7 @@ const SummonGrid = (props: Props) => {
grid={props.grid} grid={props.grid}
editable={false} editable={false}
exists={false} exists={false}
offset={numSummons}
onSelect={ onSelect={
function (type: GridType, summon: Summon, position: number): void { function (type: GridType, summon: Summon, position: number): void {
throw new Error('Function not implemented.') throw new Error('Function not implemented.')

View file

@ -33,6 +33,7 @@ const WeaponGrid = (props: Props) => {
grid={props.grid} grid={props.grid}
editable={props.editable} editable={props.editable}
exists={false} exists={false}
offset={numWeapons}
onSelect={ onSelect={
function (type: GridType, weapon: Weapon, position: number): void { function (type: GridType, weapon: Weapon, position: number): void {
throw new Error('Function not implemented.') throw new Error('Function not implemented.')