Coding > FPC Valkyrie

Suggested "vnode" expansion

<< < (2/3) > >>

Igor Savin:
\Oh no, never do that. Because you don't know wheter creation was successful -- TCreature.Create (you should use Create for all constructors -_-) can return nil if out of memory, or a error happens\

Point taken.

\BTW, Party can override Add, and keep last creature added as a TCreature pointer -- this way you'll be able to avoid typecasts too, and be a lot safer!\

Hmmm... This requires additional coding just as well, but might be great structure-wise. Thanks.

\A TManagedArray would be a wiser choice here anyway\

I'll look into it.

\The first one doesn't exist yet, but I'll implement it, for it may come in use soon!\

Project Sa...?..

\It does under 32bit linux, or else there'd be no DoomRL for linux :P.\

Ah, so it's my x64 to be blamed :).

\ChildCount and DestroyChildren implemented in revision 108\

Splendid.

A question: Why not call TNode.Clean from TNode.Create? What's the rationale behind redundant code?

Kornel Kisielewicz:

--- Quote from: Igor Savin on January 14, 2008, 13:52 ---\The first one doesn't exist yet, but I'll implement it, for it may come in use soon!\

Project Sa...?..

--- End quote ---
Yep. It will take advantage of all Valkyrie features like EventQueues and UIDs, and of yet unimplemented features as well (Messages ^^).


--- Quote from: Igor Savin on January 14, 2008, 13:52 ---\It does under 32bit linux, or else there'd be no DoomRL for linux :P.\

Ah, so it's my x64 to be blamed :).

--- End quote ---
No, my laziness is to be blamed xP.


--- Quote from: Igor Savin on January 14, 2008, 13:52 ---\ChildCount and DestroyChildren implemented in revision 108\

Splendid.

A question: Why not call TNode.Clean from TNode.Create? What's the rationale behind redundant code?

--- End quote ---
Point taken, revision 109 commited.

Igor Savin:
Kornel, there is a potential problem in current ChildCount mechanism. Since Detach (which decreases the counter) does not set Parent to nil, if I first manually Detach node and then Add it somewhere, counter will be decreased twice (parent<> nil -> Detach).

It might be a better idea to couple dec(ChildCount) with Destroy and Add.

Or finally make Detach set Parent to nil :). Do you actually ever need Parent of detached node?..

Kornel Kisielewicz:
Parent should be set to nil anyway. I hope that doesn't produce errors in existing code. I'll commit that change.

Igor Savin:
Thanks for all the support provided; I hope I won't bug you anymore in the nearest future. Sorry for all the inconvenience caused; I understand you have your own battles to fight (and latest DoomRL release doesn't seem to go so smoothly). I really appreciate your kind attention.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version