2021-08-19 07:45:26 +02:00
|
|
|
import React from "react";
|
2021-06-18 22:22:12 +02:00
|
|
|
import { GeneralActionElem } from "./GeneralActionElem";
|
|
|
|
import { Action } from "../Action";
|
|
|
|
import { GeneralActions } from "../GeneralActions";
|
2021-08-16 04:35:43 +02:00
|
|
|
import { IBladeburner } from "../IBladeburner";
|
2021-08-16 07:35:05 +02:00
|
|
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
2021-06-18 22:22:12 +02:00
|
|
|
|
|
|
|
interface IProps {
|
2021-09-05 01:09:30 +02:00
|
|
|
bladeburner: IBladeburner;
|
|
|
|
player: IPlayer;
|
2021-06-18 22:22:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function GeneralActionList(props: IProps): React.ReactElement {
|
2021-09-05 01:09:30 +02:00
|
|
|
const actions: Action[] = [];
|
|
|
|
for (const name in GeneralActions) {
|
|
|
|
if (GeneralActions.hasOwnProperty(name)) {
|
|
|
|
actions.push(GeneralActions[name]);
|
2021-06-18 22:22:12 +02:00
|
|
|
}
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{actions.map((action: Action) => (
|
|
|
|
<li key={action.name} className="bladeburner-action">
|
2021-09-09 05:47:34 +02:00
|
|
|
<GeneralActionElem bladeburner={props.bladeburner} action={action} player={props.player} />
|
2021-09-05 01:09:30 +02:00
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|