cancelOrder Params

Why is this defined in so many places
This commit is contained in:
Snarling 2022-08-19 19:49:09 -04:00
parent 4001b4cbb0
commit 2aca8476b6
5 changed files with 10 additions and 10 deletions

@ -13,8 +13,8 @@ import { PositionTypes } from "../data/PositionTypes";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";
import { EventEmitter } from "../../utils/EventEmitter"; import { EventEmitter } from "../../utils/EventEmitter";
import { WorkerScript } from "../../Netscript/WorkerScript";
import { ICancelOrderParams } from "../StockMarket"; import { ICancelOrderParams } from "../StockMarket";
import { NetscriptContext } from "../../Netscript/APIWrapper";
type txFn = (stock: Stock, shares: number) => boolean; type txFn = (stock: Stock, shares: number) => boolean;
type placeOrderFn = ( type placeOrderFn = (
@ -28,7 +28,7 @@ type placeOrderFn = (
type IProps = { type IProps = {
buyStockLong: txFn; buyStockLong: txFn;
buyStockShort: txFn; buyStockShort: txFn;
cancelOrder: (params: ICancelOrderParams, workerScript?: WorkerScript) => void; cancelOrder: (params: ICancelOrderParams, ctx?: NetscriptContext) => void;
eventEmitterForReset?: EventEmitter<[]>; eventEmitterForReset?: EventEmitter<[]>;
initStockMarket: () => void; initStockMarket: () => void;
p: IPlayer; p: IPlayer;

@ -32,7 +32,7 @@ import Collapse from "@mui/material/Collapse";
import ExpandMore from "@mui/icons-material/ExpandMore"; import ExpandMore from "@mui/icons-material/ExpandMore";
import ExpandLess from "@mui/icons-material/ExpandLess"; import ExpandLess from "@mui/icons-material/ExpandLess";
import { ICancelOrderParams } from "../StockMarket"; import { ICancelOrderParams } from "../StockMarket";
import { WorkerScript } from "../../Netscript/WorkerScript"; import { NetscriptContext } from "../../Netscript/APIWrapper";
enum SelectorOrderType { enum SelectorOrderType {
Market = "Market Order", Market = "Market Order",
@ -52,7 +52,7 @@ type placeOrderFn = (
type IProps = { type IProps = {
buyStockLong: txFn; buyStockLong: txFn;
buyStockShort: txFn; buyStockShort: txFn;
cancelOrder: (params: ICancelOrderParams, workerScript?: WorkerScript) => void; cancelOrder: (params: ICancelOrderParams, ctx?: NetscriptContext) => void;
orders: Order[]; orders: Order[];
p: IPlayer; p: IPlayer;
placeOrder: placeOrderFn; placeOrder: placeOrderFn;

@ -12,10 +12,10 @@ import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import { ICancelOrderParams } from "../StockMarket"; import { ICancelOrderParams } from "../StockMarket";
import { WorkerScript } from "../../Netscript/WorkerScript"; import { NetscriptContext } from "../../Netscript/APIWrapper";
type IProps = { type IProps = {
cancelOrder: (params: ICancelOrderParams, workerScript?: WorkerScript) => void; cancelOrder: (params: ICancelOrderParams, ctx?: NetscriptContext) => void;
order: Order; order: Order;
}; };

@ -11,10 +11,10 @@ import { Stock } from "../Stock";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";
import { ICancelOrderParams } from "../StockMarket"; import { ICancelOrderParams } from "../StockMarket";
import { WorkerScript } from "../../Netscript/WorkerScript"; import { NetscriptContext } from "../../Netscript/APIWrapper";
type IProps = { type IProps = {
cancelOrder: (params: ICancelOrderParams, workerScript?: WorkerScript) => void; cancelOrder: (params: ICancelOrderParams, ctx?: NetscriptContext) => void;
orders: Order[]; orders: Order[];
p: IPlayer; p: IPlayer;
stock: Stock; stock: Stock;

@ -15,8 +15,8 @@ import { PositionTypes } from "../data/PositionTypes";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";
import { EventEmitter } from "../../utils/EventEmitter"; import { EventEmitter } from "../../utils/EventEmitter";
import { WorkerScript } from "../../Netscript/WorkerScript";
import { ICancelOrderParams } from "../StockMarket"; import { ICancelOrderParams } from "../StockMarket";
import { NetscriptContext } from "../../Netscript/APIWrapper";
type txFn = (stock: Stock, shares: number) => boolean; type txFn = (stock: Stock, shares: number) => boolean;
type placeOrderFn = ( type placeOrderFn = (
@ -30,7 +30,7 @@ type placeOrderFn = (
type IProps = { type IProps = {
buyStockLong: txFn; buyStockLong: txFn;
buyStockShort: txFn; buyStockShort: txFn;
cancelOrder: (params: ICancelOrderParams, workerScript?: WorkerScript) => void; cancelOrder: (params: ICancelOrderParams, ctx?: NetscriptContext) => void;
eventEmitterForReset?: EventEmitter<[]>; eventEmitterForReset?: EventEmitter<[]>;
p: IPlayer; p: IPlayer;
placeOrder: placeOrderFn; placeOrder: placeOrderFn;