Sound class changes

Discuss API design here.
User avatar
satoon101
Project Leader
Posts: 2289
Joined: Sat Jul 07, 2012 1:59 am

Sound class changes

Postby satoon101 » Thu Jan 14, 2016 2:54 am

We decided to update the Sound class a little to match the other recipient classes. Now, you no longer pass recipients when creating an instance. Passing recipients is now solely handled in the play method.

Also, we swapped the index and sample arguments and gave index a default value. From now on, to get an instance, the only required argument is the sample (sound path).


Previously:

Syntax: Select all

# Use parentheses to denote no recipients
# Pass the WORLD_ENTITY_INDEX index
Sound((), 0, 'my/sound/path.mp3')

Now:

Syntax: Select all

Sound('my/sound/path.mp3')
Image
User avatar
iPlayer
Developer
Posts: 445
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Thu Jan 14, 2016 11:37 am

What's the difference between WORLD_ENTITY_INDEX and SOUND_FROM_WORLD? Wouldn't SOUND_FROM_WORLD be ideologically better since otherwise it's not used anywhere?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • arcadmin • AdPurge

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2289
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Jan 15, 2016 10:11 am

Thank you, I just forgot all about that constant. I will update shortly.
Image

Return to “API Design”

Who is online

Users browsing this forum: No registered users and 1 guest