In article i9lfbu$1a...@localhost.localdomain,
Martin Gregorie mar...@address-in-sig.invalid wrote:
On Tue, 19 Oct 2010 19:49:20 -0400, Dave Angel wrote:
Thanks, that is what I was trying to say. In the same sense that
emptying a list makes it quite small, if it's a general purpose object,
Jonathan Hartley wrote:
One common way to store delayed actions is as a lambda (an anonymous
function.)
Although note that you don't have to use 'lambda' in
particular -- functions defined with 'def' can be used
the same way.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 20, 12:11 pm, dex josipmisko...@gmail.com wrote:
On Oct 20, 12:25 pm, Jonathan Hartley tart...@tartley.com wrote:
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing,
On Oct 20, 12:11 pm, dex josipmisko...@gmail.com wrote:
On Oct 20, 12:25 pm, Jonathan Hartley tart...@tartley.com wrote:
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing,
On Oct 20, 12:11 pm, dex josipmisko...@gmail.com wrote:
On Oct 20, 12:25 pm, Jonathan Hartley tart...@tartley.com wrote:
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing,
On Oct 19, 8:08 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Oct 19, 1:19 am, dex josipmisko...@gmail.com wrote:
I'm not sure if it's a good idea to let an item disappear from your
inventory by a weak reference disappearing. It seems a little shaky
to not know where your
On Oct 19, 6:54 pm, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Tue, 19 Oct 2010 01:19:48 -0700 (PDT), dex josipmisko...@gmail.com
declaimed the following in gmane.comp.python.general:
OK, imagine a MUD, where players can dig out new rooms. Room A has a
door that holds reference to
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing, and I think I may have
tendency to over-engineer simple things. Can anybody please check my
problems-solutions and point me to
On Oct 20, 11:25 am, Jonathan Hartley tart...@tartley.com wrote:
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing, and I think I may have
tendency to over-engineer simple
On Oct 20, 12:25 pm, Jonathan Hartley tart...@tartley.com wrote:
On Oct 18, 8:28 am, dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing, and I think I may have
tendency to over-engineer simple
I'm not sure if it's a good idea to let an item disappear from your
inventory by a weak reference disappearing. It seems a little shaky
to not know where your objects are being referenced, but that's yout
decision.
OK, imagine a MUD, where players can dig out new rooms. Room A has a
door
On 2:59 PM, dex wrote:
I'm not sure if it's a good idea to let an item disappear from your
inventory by a weak reference disappearing. It seems a little shaky
to not know where your objects are being referenced, but that's yout
decision.
OK, imagine a MUD, where players can dig out new rooms.
dex josipmisko...@gmail.com wrote:
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing
Such is often the case in real life code :-)
In turn-based games, the order of action execution in battle can give
unfair advantage to players.
On Tue, Oct 19, 2010 at 5:37 AM, Dave Angel da...@ieee.org wrote:
On 2:59 PM, dex wrote:
Using strong references, I have to remove room B from list of rooms,
and also remove door to room B, as it holds reference to room B. To do
that, I have to keep list of doors that lead to room B.
On Oct 19, 1:19 am, dex josipmisko...@gmail.com wrote:
I'm not sure if it's a good idea to let an item disappear from your
inventory by a weak reference disappearing. It seems a little shaky
to not know where your objects are being referenced, but that's yout
decision.
OK, imagine a
On 10/19/2010 1:46 PM, Ian Kelly wrote:
On Tue, Oct 19, 2010 at 5:37 AM, Dave Angel da...@ieee.org
mailto:da...@ieee.org wrote:
On 2:59 PM, dex wrote:
Using strong references, I have to remove room B from list of rooms,
and also remove door to room B, as it holds
On 2:59 PM, Terry Reedy wrote:
On 10/19/2010 1:46 PM, Ian Kelly wrote:
On Tue, Oct 19, 2010 at 5:37 AM, Dave Angel da...@ieee.org
mailto:da...@ieee.org wrote:
snip
Simply replace room B with a destroyed room object. That can be
quite small, and you only need one, regardless of how
On Tue, 19 Oct 2010 19:49:20 -0400, Dave Angel wrote:
Thanks, that is what I was trying to say. In the same sense that
emptying a list makes it quite small, if it's a general purpose object,
you just want to remove all the attributes.
I think a 'place' (to generalise it) is quite a small
I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing, and I think I may have
tendency to over-engineer simple things. Can anybody please check my
problems-solutions and point me to more elegant solution?
Every item/character/room is a
On Oct 18, 12:28 am, dex josipmisko...@gmail.com wrote:
Every item/character/room is a separate object. Items/characters need
to have references to room they are in, and room needs to have a list
of references to items/characters that are contained within. I decided
to use weak references.
dex wrote:
In each object's
__init__() that object is added to game_object list, and in each
__del__() they are removed from game_object list. This mechanism keeps
them safe from garbage collector. How pythonic is this design?
You don't have to manage memory with python, I don't know if you
You're aware Python can collect reference cycles, correct? You don't
have to delete references; Python will get them eventually.
I'm not sure I understand this part? If I don't delete all strong
references, the object will not be deleted.
It will persist and occupy memory as long as there's
On Mon, Oct 18, 2010 at 9:50 AM, dex josipmisko...@gmail.com wrote:
You're aware Python can collect reference cycles, correct? You don't
have to delete references; Python will get them eventually.
I'm not sure I understand this part? If I don't delete all strong
references, the object will
On Oct 18, 6:50 am, dex josipmisko...@gmail.com wrote:
You're aware Python can collect reference cycles, correct? You don't
have to delete references; Python will get them eventually.
I'm not sure I understand this part? If I don't delete all strong
references, the object will not be
24 matches
Mail list logo