naev 0.10.4
Functions | Variables
land_trade.c File Reference

Handles the Trading Center at land. More...

#include "land_trade.h"
#include "array.h"
#include "commodity.h"
#include "dialogue.h"
#include "economy.h"
#include "hook.h"
#include "land_shipyard.h"
#include "log.h"
#include "map_find.h"
#include "ndata.h"
#include "nstring.h"
#include "player.h"
#include "player_fleet.h"
#include "space.h"
#include "tk/toolkit_priv.h"
#include "toolkit.h"

Go to the source code of this file.

Functions

void commodity_exchange_open (unsigned int wid)
 Opens the local market window. More...
 
void commodity_exchange_cleanup (void)
 
void commodity_update (unsigned int wid, const char *str)
 Updates the commodity window. More...
 
int commodity_canBuy (const Commodity *com)
 Checks to see if the player can buy a commodity. More...
 
int commodity_canSell (const Commodity *com)
 Checks to see if a player can sell a commodity. More...
 
void commodity_buy (unsigned int wid, const char *str)
 Buys the selected commodity. More...
 
void commodity_sell (unsigned int wid, const char *str)
 Attempts to sell a commodity. More...
 
int commodity_getMod (void)
 Gets the current modifier status. More...
 
void commodity_renderMod (double bx, double by, double w, double h, void *data)
 Renders the commodity buying modifier. More...
 

Variables

static int commodity_mod = 10
 
static Commodity ** commodity_list = NULL
 

Detailed Description

Handles the Trading Center at land.

Definition in file land_trade.c.

Function Documentation

◆ commodity_buy()

void commodity_buy ( unsigned int  wid,
const char *  str 
)

Buys the selected commodity.

Parameters
widWindow buying from.
strUnused.

Definition at line 335 of file land_trade.c.

◆ commodity_canBuy()

int commodity_canBuy ( const Commodity com)

Checks to see if the player can buy a commodity.

Definition at line 282 of file land_trade.c.

◆ commodity_canSell()

int commodity_canSell ( const Commodity com)

Checks to see if a player can sell a commodity.

Definition at line 320 of file land_trade.c.

◆ commodity_exchange_cleanup()

void commodity_exchange_cleanup ( void  )

Definition at line 172 of file land_trade.c.

◆ commodity_exchange_open()

void commodity_exchange_open ( unsigned int  wid)

Opens the local market window.

Definition at line 45 of file land_trade.c.

◆ commodity_getMod()

int commodity_getMod ( void  )

Gets the current modifier status.

Returns
The amount modifier when buying or selling commodities.

Definition at line 417 of file land_trade.c.

◆ commodity_renderMod()

void commodity_renderMod ( double  bx,
double  by,
double  w,
double  h,
void *  data 
)

Renders the commodity buying modifier.

Parameters
bxBase X position to render at.
byBase Y position to render at.
wWidth to render at.
hHeight to render at.
dataUnused.

Definition at line 437 of file land_trade.c.

◆ commodity_sell()

void commodity_sell ( unsigned int  wid,
const char *  str 
)

Attempts to sell a commodity.

Parameters
widWindow selling commodity from.
strUnused.

Definition at line 376 of file land_trade.c.

◆ commodity_update()

void commodity_update ( unsigned int  wid,
const char *  str 
)

Updates the commodity window.

Parameters
widWindow to update.
strUnused.

Definition at line 183 of file land_trade.c.

Variable Documentation

◆ commodity_list

Commodity** commodity_list = NULL
static

Definition at line 40 of file land_trade.c.

◆ commodity_mod

int commodity_mod = 10
static

Amount you can buy or sell in a single click.

Definition at line 39 of file land_trade.c.