mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 20:17:16 +02:00
remove deprecated helper method
change alter_cache to update_cache to better match what the method does (+1 squashed commits) Squashed commits: [23d61e14d] fix test
This commit is contained in:
parent
17d709da68
commit
f98672541f
2 changed files with 3 additions and 13 deletions
|
|
@ -234,8 +234,8 @@ class BaseBuff:
|
|||
self.start = time.time()
|
||||
self.handler.buffcache[self.buffkey]["start"] = time.time()
|
||||
|
||||
def alter_cache(self, to_cache: dict):
|
||||
"""Alters this buff's cache, both internally (this instance) and on the handler's buff cache.
|
||||
def update_cache(self, to_cache: dict):
|
||||
"""Updates this buff's cache using the given values, both internally (this instance) and on the handler.
|
||||
|
||||
Args:
|
||||
to_cache: The dictionary of values you want to add to the cache"""
|
||||
|
|
@ -930,16 +930,6 @@ class BuffHandler:
|
|||
)
|
||||
return
|
||||
|
||||
def set_duration(self, key, value):
|
||||
"""Sets the duration of the specified buff.
|
||||
|
||||
Args:
|
||||
key: The key of the buff whose duration you want to set
|
||||
value: The value you want the new duration to be"""
|
||||
if key in self.buffcache.keys():
|
||||
self.buffcache[key]["duration"] = value
|
||||
return
|
||||
|
||||
def view(self, to_filter=None) -> dict:
|
||||
"""Returns a buff flavor text as a dictionary of tuples in the format {key: (name, flavor)}. Common use for this is a buff readout of some kind.
|
||||
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ class TestBuffsAndHandler(EvenniaTest):
|
|||
_instance.at_tick()
|
||||
self.assertTrue(self.testobj.db.ticktest)
|
||||
# test duration modification and cleanup
|
||||
handler.set_duration("ttib", 0)
|
||||
_instance.duration = 0
|
||||
self.assertEqual(handler.get("ttib").duration, 0)
|
||||
handler.cleanup()
|
||||
self.assertFalse(handler.get("ttib"), None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue