Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

What's the best way to have a unlimited...

Developers
2011-04-05
2013-06-06
  • Is creating it with capacity of -1 good enough? I guess it'll never be full.

    Any concerns about this type of slots?

     
  • Katie Russell
    Katie Russell
    2011-04-08

    Sorry, what is 'it' ?
    I think maybe a word was forgotten from the title or I am missing context.

     
  • Katie Russell
    Katie Russell
    2011-04-10

    The javadoc says:

            /**
         * Returns the maximum amount of objects that can be stored at the slot.
         * When there is no limit we use the -1 value.
         *
         * @return the maximum amount of objects that can be stored at the slot.
         */
        public int getCapacity() {
            return capacity;
        }
    

    And the constructor for deserialization sets -1 as default.

    Also for anyone else interested to read related chat, the question was answered at http://stendhalgame.org/chat/2011-04-05.html  23:31 and
    http://stendhalgame.org/chat/2011-04-09.html 22:46

    Javy_Dreamer, I am not sure what concerns you mean. You can experiment with tests on slots and objects as in tests/marauroa/common/game/

     
  • I just wanted to know if there were any concerns with this type of slot as they are stored, potentially, in the database. Can they run out of space for the RPObject?

    There are no methods in RPClass for using the default -1 slot. That's why I asked.

     


Anonymous


Cancel   Add attachments