Not logged inOpenClonk Forum
Up Topic New LiquidPump System

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to ST-DDT

>generally, use meaningful identifiers which are self explanatory: e.g. weapon_strength rather than iStr
>don't use hungarian notation, preferably use lowercase_separated_by_underscores for variables


lowercase ok ill change that
hungarian notation vs meaningful identifiers, what identifiers are more meaningfull than sznMaterial? this var tells me its a string (sz), its declared as input (n) and its a material
-mat could be anything, but you can guess its material
-and max? ...
-why is wild_card sperated via _?
Somewhere in that code I've read sz.... and i never used sz before (s only)

>use CamelCase() for functions


i did

>use PREFIX_Identifier for static constants


I didn't use any

>But you provide us with the unused libraries, without telling what they can be used for.


BarrelFiller:
"Author: ST-DDT
Import this to allow the structures to
-fill liquids which has been pumped into the building into barrels
-extract liquids from barrels and pump it somewhere else"


what else should i write there?
should i write that if you import this via #include into your structures and also objects in common,
that all inserted materials (via pipe or other ways) are put into barrels and that all extracted materials are extracted from barrels?
(you also can declare this as global func to add this functionality to every object connected to a pipline)

the tank lib does nearly the same but it doesn't fill liquids into and extract liquids from barrels, it provides an internal tank.
if you limit the liquids to oil this lib could be used to put fuel into steamengine and this very very easyly.
LiquidInput(string mat......)
{
if (mat!="oil")
return 0;
return _inherited(...);
}

Maybe i missed something when reading libary but in java I include libaries to add additional functions to an object.
And this two libaries does nothing else than adding additional features to (selected) objects which aren't developed so far.
Maybe call it samplecode, but somewhere this functions have to be writen otherwise people won't know how to use.
Maybe i have chosen the wrong expressions/words, because i didn't use english for ages. and i have trusted my translation tool.

btw:
if i have to change this all, please tell me:
Shall i use int mat or string mat as parametre?
int does not support wildcard, but would be less complex for code readers

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill