Information lib with constants in it

Discuss API design here.
Absolute
Junior Member
Posts: 13
Joined: Sat Jul 07, 2012 6:48 pm

Information lib with constants in it

Postby Absolute » Sun Sep 02, 2012 3:04 pm

It would be cool to have a library from which you can import constants from, to make the code more readable.
For example you could have CS_TEAM_CT = 3, or you could have all the flags in that lib.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Sun Sep 02, 2012 3:06 pm

Indeed, would make things a lot easier. Then again, you can write it in a simple .py file by yourself too. Also, there seems to be a small discussion about team's already, you should check the page 2 atleast.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Sun Sep 02, 2012 4:39 pm

Mh, another approach is to do this with ini files. Though py should just work as well.

Though I think there should be more general constants like TEAM_UNASSIGNED TEAM_SPECTATOR TEAM_1 TEAM_2 or so to make things compatible. Actually something else to discuss is whether to make constants really constant, so you can't change their values (by accident/easily).
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Mon Sep 03, 2012 1:05 am

There actually is a .ini file for this... but IDK what it is being used for, or how you can use it easily (without the need to ConfigObj it yourself) in scripts: http://code.google.com/p/source-python/source/browse/addons/source-python/_libs/_data/players/teams/csgo.ini
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Sep 03, 2012 2:14 pm

Currently that file is only used for PlayerIter. It uses the game's .ini file to add the teams to the filter manager.

Satoon
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Mon Sep 03, 2012 7:51 pm

satoon101 wrote:Currently that file is only used for PlayerIter. It uses the game's .ini file to add the teams to the filter manager.

Satoon


So we can assume this file will be used later for the whole plugin? =)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Sep 03, 2012 9:22 pm

It can be used by anyone for any purpose right now. I only said "currently" because we could end up using it for other functionality later in development.

Satoon
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Mon Sep 03, 2012 10:36 pm

satoon101 wrote:It can be used by anyone for any purpose right now. I only said "currently" because we could end up using it for other functionality later in development.

Satoon


Yeah, that's what I also meant =) you're doing great work with this!

Return to “API Design”

Who is online

Users browsing this forum: No registered users and 14 guests