Changes

Jump to navigation Jump to search
25 bytes removed ,  02:15, 24 May 2018
rearrange
Line 10: Line 10:  
==Items==
 
==Items==
 
Items are objects which represent things which can be put in an inventory. Tools, Crops, etc.  
 
Items are objects which represent things which can be put in an inventory. Tools, Crops, etc.  
===Create an Item===
  −
//todo
  −
===Remove an Item===
  −
//todo
  −
===Add an item to an inventory===
  −
//todo
  −
===Remove an item from an inventory===
     −
This is dependent on the inventory - rarely will you be calling this directly, as the game has functions for this for the Player, located in Farmer (in the main namespace).
+
===Create an Item (Object)===
 +
All constructors for Object:
 +
 
 +
<source lang='c#'>
 +
public Object(Vector2 tileLocation, int parentSheetIndex, int initialStack);
 +
public Object(Vector2 tileLocation, int parentSheetIndex, bool isRecipe = false);
 +
public Object(int parentSheetIndex, int initialStack, bool isRecipe = false, int price = -1, int quality = 0);
 +
public Object(Vector2 tileLocation, int parentSheetIndex, string Givenname, bool canBeSetDown, bool canBeGrabbed, bool isHoedirt, bool isSpawnedObject);
 +
</source>
   −
To do so, in most situations, just call .removeItemFromInventory(Item)
+
Where '''parentSheetIndex''' is the ID of the item (can be found in ObjectInformation.xnb).
    
===Spawn an item on the ground===
 
===Spawn an item on the ground===
Line 31: Line 32:  
</source>
 
</source>
    +
===Add an item to an inventory===
 +
//todo
   −
All constructors for Object:
+
===Remove an item from an inventory===
   −
<source lang='c#'>
+
This is dependent on the inventory - rarely will you be calling this directly, as the game has functions for this for the Player, located in Farmer (in the main namespace).
public Object(Vector2 tileLocation, int parentSheetIndex, int initialStack);
  −
public Object(Vector2 tileLocation, int parentSheetIndex, bool isRecipe = false);
  −
public Object(int parentSheetIndex, int initialStack, bool isRecipe = false, int price = -1, int quality = 0);
  −
public Object(Vector2 tileLocation, int parentSheetIndex, string Givenname, bool canBeSetDown, bool canBeGrabbed, bool isHoedirt, bool isSpawnedObject);
  −
</source>
     −
Where '''parentSheetIndex''' is the ID of the item (can be found in ObjectInformation.xnb).
+
To do so, in most situations, just call .removeItemFromInventory(Item)
    
==Locations==
 
==Locations==
37

edits

Navigation menu