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

View file

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

View file

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

View file

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