naev 0.11.5
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

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

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 362 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 307 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 346 of file land_trade.c.

◆ commodity_exchange_cleanup()

void commodity_exchange_cleanup ( void )

Definition at line 197 of file land_trade.c.

◆ commodity_exchange_events()

static int commodity_exchange_events ( unsigned int wid,
SDL_Event * evt )
static

Definition at line 56 of file land_trade.c.

◆ commodity_exchange_modifiers()

static void commodity_exchange_modifiers ( unsigned int wid)
static

Definition at line 42 of file land_trade.c.

◆ commodity_exchange_open()

void commodity_exchange_open ( unsigned int wid)

Opens the local market window.

Definition at line 66 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 448 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 470 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 405 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 208 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.