Home

[Package Index | Mudlib Index | Effect Index]

File /std/shops/inherit/commercial.c

This is the file that is the basic inheritable for commercial properties. The only different between commercial properties and player housing properties is that commerical ones can deal with signs and commercial furniture.

Written by Pinkfish

Started Fri Apr 21 13:37:44 PDT 2000

Inherits

This class inherits the following classes /std/shops/inherit/person_expressions.c, /std/room/player_housing.c and /std/shops/inherit/expression_util.c

Includes

This class includes the following files /include/player.h, /include/mail.h, /include/player_handler.h, /include/shops/bank.h, /include/money.h, /include/expressions.h, /include/move_failures.h and /include/playtesters.h

Class Index

Method index

  • add_commercial_thing(object)
    This method adds a commercial thing into the list of current commercial things.
  • adjust_royalty(string, int)
    This method adds money into the specified person's royalty float.
  • do_add_royalties(string)
    Adds money into the float for the shop.
  • do_black_list_add(string)
    This method adds the person to the black list.
  • do_black_list_add_ignore()
    This method adds their ignore list to the black list
  • do_black_list_remove(string)
    This method removes the person from the black list.
  • do_collect()
    This method shows the current royalties you can pick up.
  • do_collect_partial_royalties(string)
    This method collects royalities up to a certain amount.
  • do_deposit(object *)
    This method deposits money into the float
  • do_measure()
  • do_name_property(string)
    This method gives the property a name.
  • do_pay_entry()
    This method lets the person pay for entry into the premesis.
  • do_purchase()
    This methof calls ups the estate person to purchase stuff off.
  • do_remove_sign()
    This method removes the sign from the property.
  • do_royalties()
    This method shows any royalties that you might be able to collect.
  • do_royalty_list()
    This method shows any royalties that you might be able to collect.
  • do_set_sign(object *)
    This method sets the sign you wish to use for your property.
  • do_use_expression(string)
    This method sets up the expression to use when calculating the ability to use the shop.
  • do_use_expression_type(string, string)
    This method sets up the expression to use when calculating the ability to use the shop.
  • find_commercial_items(string)
    This function will try and track down a specific type of commercial object in the current location.
  • find_next_commercial_id()
    This method finds a unique commercial id in the room to use as new save file.
  • is_open_for(string, string)
    This method is called to try and see if the property is open for the specific type of thingy attempted.
  • long(string, int)
    This gets round the problems with setting the property name before we have a save file.
  • mail_weekly_status()
    This method will mail out the weekly status for the shop.
  • query_commercial_property()
    This method returns true for any commercial property.
  • query_commercial_things()
    This method returns the current list of commercial things in the room.
  • query_commercial_type()
    This method returns the commercial type of the property.
  • query_float()
    This method returns the float of the property.
  • query_language()
    This method returns the language items in the shop should use if they need to use a language.
  • query_main_room()
    This method checks returns the main room.
  • query_owners_money()
    This method figures out how much float the owner has in the current property.
  • query_parcel_post()
    This method tells us the current parcel post used for rejecting items.
  • query_property_name()
    This method returns the name of the property.
  • query_property_size()
    This method returns the size of the property.
  • query_royalty(string)
    This method returns the amount of money in the specified person's royalty float.
  • query_save_dir()
    This method returns the save directory for the room.
  • query_sign_object()
    This method returns the current sign object for the property.
  • query_weekly_status_string()
    This method returns the string that will be sent to the owners at the end of the week.
  • register_use_types(string *)
    This registers a set of use types so they can be seen and controlled.
  • remove_commercial_thing(object)
    This method removes a commercil thing from the list of current commercial things.
  • reset_weekly_status()
    This method resets the weekly status when the stats are mailed out.
  • set_commercial_type(string)
    This method sets the commercial type of the property.
  • set_language(string)
    This sets the language items in the shop should be displayed in, if a language is required.
  • set_parcel_post(string)
    This method sets the parcel post to use for rejecting items.
  • set_property_name(string)
    This method sets the name of the property.
  • set_property_size(int)
    This method sets the size of the property.
  • set_save_dir(string)
    This method sets the save directory for the the room.
  • set_sign_object(object)
    This method sets the current sign object.
  • short()
    This gets round the problems with setting the property name before we have a save file.

Public Functions

These are functions that everyone can access.

.

    add_commercial_thing
    void add_commercial_thing(object ob)
    

    This method adds a commercial thing into the list of current commercial things.
    • Parameters:
      thing - the thing to add
    adjust_royalty
    void adjust_royalty(string person,
                        int amount)
    

    This method adds money into the specified person's royalty float.
    • Parameters:
      person - the person to add the royalty to
      amount - the amount to add
        do_add_royalties
        int do_add_royalties(string amount)
        

        Adds money into the float for the shop.
        • Parameters:
          amount - the amount to add to the float
            do_black_list_add
            int do_black_list_add(string name)
            

            This method adds the person to the black list.
            • Parameters:
              person - the person to add to the black list
                do_black_list_add_ignore
                int do_black_list_add_ignore()
                

                This method adds their ignore list to the black list
                  do_black_list_remove
                  int do_black_list_remove(string name)
                  

                  This method removes the person from the black list.
                  • Parameters:
                    person - the person to remove from the black list
                      do_collect
                      int do_collect()
                      

                      This method shows the current royalties you can pick up.
                        do_collect_partial_royalties
                        int do_collect_partial_royalties(string amount)
                        

                        This method collects royalities up to a certain amount. This is only usable by the owner of the shop.
                        • Parameters:
                          amount - the amount to collect
                        • Returns:
                          1 on success, 0 on failure
                            do_deposit
                            int do_deposit(object * obs)
                            

                            This method deposits money into the float
                            • Parameters:
                              obs - the objects which could be money
                                do_measure
                                int do_measure()
                                
                                  do_name_property
                                  int do_name_property(string name)
                                  

                                  This method gives the property a name.
                                    do_pay_entry
                                    int do_pay_entry()
                                    

                                    This method lets the person pay for entry into the premesis.
                                      do_purchase
                                      int do_purchase()
                                      

                                      This methof calls ups the estate person to purchase stuff off.
                                        do_remove_sign
                                        int do_remove_sign()
                                        

                                        This method removes the sign from the property.
                                          do_royalties
                                          int do_royalties()
                                          

                                          This method shows any royalties that you might be able to collect.
                                          • Returns:
                                            1 on succes, 0 on failure
                                              do_royalty_list
                                              int do_royalty_list()
                                              

                                              This method shows any royalties that you might be able to collect.
                                              • Returns:
                                                1 on succes, 0 on failure
                                                  do_set_sign
                                                  int do_set_sign(object * obs)
                                                  

                                                  This method sets the sign you wish to use for your property. The sign will be displayed outside the property for passer bys.
                                                  • Parameters:
                                                    obs - the sign
                                                      do_use_expression
                                                      int do_use_expression(string str)
                                                      

                                                      This method sets up the expression to use when calculating the ability to use the shop.
                                                        do_use_expression_type
                                                        int do_use_expression_type(string type,
                                                                                   string str)
                                                        

                                                        This method sets up the expression to use when calculating the ability to use the shop.
                                                          find_commercial_items
                                                          object * find_commercial_items(string type)
                                                          

                                                          This function will try and track down a specific type of commercial object in the current location. It will look into 'partitioned' rooms for the item as well.
                                                          • Parameters:
                                                            type - the type to look for
                                                          • Returns:
                                                            the object found
                                                              find_next_commercial_id
                                                              int find_next_commercial_id()
                                                              

                                                              This method finds a unique commercial id in the room to use as new save file.
                                                              • Returns:
                                                                a unique commercial id for the room
                                                                  is_open_for
                                                                  int is_open_for(string type,
                                                                                  string person)
                                                                  

                                                                  This method is called to try and see if the property is open for the specific type of thingy attempted.
                                                                  • Parameters:
                                                                    type - the type of thing
                                                                      long
                                                                      string long(string word,
                                                                                  int dark)
                                                                      

                                                                      This gets round the problems with setting the property name before we have a save file.
                                                                        query_commercial_property
                                                                        int query_commercial_property()
                                                                        

                                                                        This method returns true for any commercial property.
                                                                        • Returns:
                                                                          1 for commercial property
                                                                            query_commercial_things
                                                                            object * query_commercial_things()
                                                                            

                                                                            This method returns the current list of commercial things in the room.
                                                                            • Returns:
                                                                              the list of commercial things
                                                                                query_commercial_type
                                                                                string query_commercial_type()
                                                                                

                                                                                This method returns the commercial type of the property.
                                                                                • Returns:
                                                                                  the commercial type of the property
                                                                                    query_float
                                                                                    int query_float()
                                                                                    

                                                                                    This method returns the float of the property. The float is the owner's current royalty balance.
                                                                                    • Returns:
                                                                                      the float of the property
                                                                                        query_language
                                                                                        string query_language()
                                                                                        

                                                                                        This method returns the language items in the shop should use if they need to use a language.
                                                                                          query_main_room
                                                                                          object query_main_room()
                                                                                          

                                                                                          This method checks returns the main room. THis is used when the property can have multiple sub-rooms.
                                                                                          • Returns:
                                                                                            the main room
                                                                                              query_owners_money
                                                                                              int query_owners_money()
                                                                                              

                                                                                              This method figures out how much float the owner has in the current property.
                                                                                              • Returns:
                                                                                                the current float
                                                                                                  query_parcel_post
                                                                                                  string query_parcel_post()
                                                                                                  

                                                                                                  This method tells us the current parcel post used for rejecting items.
                                                                                                  • Returns:
                                                                                                    the current parcel post
                                                                                                      query_property_name
                                                                                                      string query_property_name()
                                                                                                      

                                                                                                      This method returns the name of the property.
                                                                                                      • Returns:
                                                                                                        the name of the property
                                                                                                          query_property_size
                                                                                                          int query_property_size()
                                                                                                          

                                                                                                          This method returns the size of the property. The property size ranges from 0 (no size) to 100 (big shop).
                                                                                                          • Returns:
                                                                                                            the property size
                                                                                                              query_royalty
                                                                                                              int query_royalty(string person)
                                                                                                              

                                                                                                              This method returns the amount of money in the specified person's royalty float.
                                                                                                                query_save_dir
                                                                                                                string query_save_dir()
                                                                                                                

                                                                                                                This method returns the save directory for the room. This should be used as a reference point for other save stuff.
                                                                                                                • Returns:
                                                                                                                  the save directory
                                                                                                                    query_sign_object
                                                                                                                    object query_sign_object()
                                                                                                                    

                                                                                                                    This method returns the current sign object for the property.
                                                                                                                    • Returns:
                                                                                                                      the current sign object
                                                                                                                        query_weekly_status_string
                                                                                                                        string query_weekly_status_string()
                                                                                                                        

                                                                                                                        This method returns the string that will be sent to the owners at the end of the week.
                                                                                                                        • Returns:
                                                                                                                          the weekly status
                                                                                                                            register_use_types
                                                                                                                            void register_use_types(string * types)
                                                                                                                            

                                                                                                                            This registers a set of use types so they can be seen and controlled.
                                                                                                                            • Parameters:
                                                                                                                              types - the list of types to register
                                                                                                                                remove_commercial_thing
                                                                                                                                void remove_commercial_thing(object thing)
                                                                                                                                

                                                                                                                                This method removes a commercil thing from the list of current commercial things.
                                                                                                                                • Parameters:
                                                                                                                                  thing - the thing to remove
                                                                                                                                    reset_weekly_status
                                                                                                                                    void reset_weekly_status()
                                                                                                                                    

                                                                                                                                    This method resets the weekly status when the stats are mailed out. It will also reset all the commercial objects.
                                                                                                                                      set_commercial_type
                                                                                                                                      void set_commercial_type(string name)
                                                                                                                                      

                                                                                                                                      This method sets the commercial type of the property.
                                                                                                                                      • Parameters:
                                                                                                                                        name - the commecial type
                                                                                                                                          set_language
                                                                                                                                          void set_language(string language)
                                                                                                                                          

                                                                                                                                          This sets the language items in the shop should be displayed in, if a language is required.
                                                                                                                                          • Parameters:
                                                                                                                                            language - the language to use
                                                                                                                                              set_parcel_post
                                                                                                                                              void set_parcel_post(string parcel)
                                                                                                                                              

                                                                                                                                              This method sets the parcel post to use for rejecting items.
                                                                                                                                              • Parameters:
                                                                                                                                                parcel - the parcel post office
                                                                                                                                                  set_property_name
                                                                                                                                                  void set_property_name(string name)
                                                                                                                                                  

                                                                                                                                                  This method sets the name of the property.
                                                                                                                                                  • Parameters:
                                                                                                                                                    name - the name of the property
                                                                                                                                                      set_property_size
                                                                                                                                                      void set_property_size(int size)
                                                                                                                                                      

                                                                                                                                                      This method sets the size of the property. The property size ranges from 0 (no size) to 100 (big shop).
                                                                                                                                                      • Parameters:
                                                                                                                                                        size - the new size of the property
                                                                                                                                                          set_save_dir
                                                                                                                                                          void set_save_dir(string dir)
                                                                                                                                                          

                                                                                                                                                          This method sets the save directory for the the room.
                                                                                                                                                          • Parameters:
                                                                                                                                                            dir - the directory to save stuff in
                                                                                                                                                              set_sign_object
                                                                                                                                                              void set_sign_object(object ob)
                                                                                                                                                              

                                                                                                                                                              This method sets the current sign object.
                                                                                                                                                              • Parameters:
                                                                                                                                                                sign - the new sign object
                                                                                                                                                                  short
                                                                                                                                                                  string short()
                                                                                                                                                                  

                                                                                                                                                                  This gets round the problems with setting the property name before we have a save file.

                                                                                                                                                                  Protected Functions

                                                                                                                                                                  These are functions that only objects inheriting the class can access.

                                                                                                                                                                    mail_weekly_status
                                                                                                                                                                    void mail_weekly_status()
                                                                                                                                                                    

                                                                                                                                                                    This method will mail out the weekly status for the shop.

                                                                                                                                                                    Classes

                                                                                                                                                                    These are nice data types for dealing with... Data!

                                                                                                                                                                    • float_withdrawls
                                                                                                                                                                      class float_withdrawls {
                                                                                                                                                                                               string person;
                                                                                                                                                                                               int amount;
                                                                                                                                                                                               int withdrawl_time;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      
                                                                                                                                                                    • royalty_data
                                                                                                                                                                      class royalty_data {
                                                                                                                                                                                           int value;
                                                                                                                                                                                           int last_withdrawl;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      
                                                                                                                                                                    • weekly_status
                                                                                                                                                                      class weekly_status {
                                                                                                                                                                                            int total_incoming;
                                                                                                                                                                                            int total_outgoing;
                                                                                                                                                                                            class float_withdrawls * withdrawls;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      
Valid HTML 4.01 Transitional
Valid CSS!
Read More