In article ,
Martin Gregorie 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,
>> you just want to remove all the attributes.
>
>I think a
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 wrote:
> On Oct 20, 12:25 pm, Jonathan Hartley wrote:
>
>
>
> > On Oct 18, 8:28 am, dex 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-engine
On Oct 20, 12:11 pm, dex wrote:
> On Oct 20, 12:25 pm, Jonathan Hartley wrote:
>
>
>
> > On Oct 18, 8:28 am, dex 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-engine
On Oct 20, 12:11 pm, dex wrote:
> On Oct 20, 12:25 pm, Jonathan Hartley wrote:
>
>
>
> > On Oct 18, 8:28 am, dex 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-engine
On Oct 20, 12:25 pm, Jonathan Hartley wrote:
> On Oct 18, 8:28 am, dex 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 chec
On Oct 20, 11:25 am, Jonathan Hartley wrote:
> On Oct 18, 8:28 am, dex 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
On Oct 18, 8:28 am, dex 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 more elegant solution?
On Oct 19, 6:54 pm, Dennis Lee Bieber wrote:
> On Tue, 19 Oct 2010 01:19:48 -0700 (PDT), dex
> 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 newly created room B. By "using" a
On Oct 19, 8:08 pm, Carl Banks wrote:
> On Oct 19, 1:19 am, 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
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
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 mailto:da...@ieee.org>> wrote:
Simply replace room B with a "destroyed room" object. That can be
quite small, and you only need one, regardless of how many rooms are
On 10/19/2010 1:46 PM, Ian Kelly wrote:
On Tue, Oct 19, 2010 at 5:37 AM, Dave Angel 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 reference to room B.
On Oct 19, 1:19 am, 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 player
On Tue, Oct 19, 2010 at 5:37 AM, Dave Angel 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.
>>
>> Using w
dex 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. [...] Is there a design
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
> 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
doo
On Oct 18, 6:50 am, dex 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 deleted.
> It will p
On Mon, Oct 18, 2010 at 9:50 AM, dex 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 deleted.
>
> 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
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 w
On Oct 18, 12:28 am, dex 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. That way I can destroy
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 separat
24 matches
Mail list logo