tModLoader v2024.03
A mod to make and play Terraria mods
AbstractNPCShop Class Referenceabstract

Inherited by NPCShop, and TravellingMerchantShop.

Classes

interface  Entry
 

Public Member Functions

 AbstractNPCShop (int npcType, string name="Shop")
 
abstract void FillShop (ICollection< Item > items, NPC npc)
 Unbounded variant of FillShop(Item[], NPC, out bool), for future forwards compatibility with tabbed or scrolling shops. More...
 
abstract void FillShop (Item[] items, NPC npc, out bool overflow)
 Fills a shop array with the contents of this shop, evaluating conditions and running callbacks. More...
 
virtual void FinishSetup ()
 
void Register ()
 

Properties

abstract IEnumerable< EntryActiveEntries [get]
 
string FullName [get]
 
string Name [get]
 
int NpcType [get]
 

Member Function Documentation

◆ FillShop() [1/2]

abstract void AbstractNPCShop.FillShop ( ICollection< Item items,
NPC  npc 
)
pure virtual

Unbounded variant of FillShop(Item[], NPC, out bool), for future forwards compatibility with tabbed or scrolling shops.

Parameters
itemsThe collection to be filled
npcThe NPC the player is talking to

Implemented in NPCShop, and TravellingMerchantShop.

◆ FillShop() [2/2]

abstract void AbstractNPCShop.FillShop ( Item[]  items,
NPC  npc,
out bool  overflow 
)
pure virtual

Fills a shop array with the contents of this shop, evaluating conditions and running callbacks.

Parameters
itemsArray to be filled.
npcThe NPC the player is talking to
overflowTrue if some items were unable to fit in the provided array

Implemented in NPCShop, and TravellingMerchantShop.