naev 0.12.6
land_trade.c File Reference

Handles the Trading Center at land. More...

#include "land_trade.h"
#include "array.h"
#include "commodity.h"
#include "economy.h"
#include "hook.h"
#include "land.h"
#include "nstring.h"
#include "player.h"
#include "player_fleet.h"
#include "space.h"
#include "toolkit.h"
Include dependency graph for land_trade.c:

Go to the source code of this file.

Functions

static void commodity_exchange_genList (unsigned int wid)
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
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 401 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 346 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 385 of file land_trade.c.

◆ commodity_exchange_cleanup()

void commodity_exchange_cleanup ( void )

Definition at line 231 of file land_trade.c.

◆ commodity_exchange_events()

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

Definition at line 53 of file land_trade.c.

◆ commodity_exchange_genList()

void commodity_exchange_genList ( unsigned int wid)
static

Definition at line 141 of file land_trade.c.

◆ commodity_exchange_modifiers()

void commodity_exchange_modifiers ( unsigned int wid)
static

Definition at line 39 of file land_trade.c.

◆ commodity_exchange_open()

void commodity_exchange_open ( unsigned int wid)

Opens the local market window.

Definition at line 63 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 491 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 513 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 446 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 242 of file land_trade.c.

Variable Documentation

◆ commodity_list

Commodity** commodity_list = NULL
static

Definition at line 34 of file land_trade.c.

◆ commodity_mod

int commodity_mod
static
Initial value:
=
10

Amount you can buy or sell in a single click.

Definition at line 32 of file land_trade.c.