static Map<S, Status> status_map; // key = dialog id static abstract class Status { abstract S answer(S s); } // get status static synchronized Status status() { status_load(); ret status_map.get(getDialogID()); } static void status_load() { if (status_map == null) { status_map = new TreeMap; load("status_map"); } } // set status static synchronized void status(Status s) { status_load(); if (s == null) status_map.remove(getDialogID()); else status_map.put(getDialogID(), s); save("status_map"); } static S status_answer(S s) { Status status = status(); if (status != null) ret status.answer(s); ret null; }
Began life as a copy of #1002567
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1002616 |
Snippet name: | status function - per-user status for Eleutheria bots |
Eternal ID of this version: | #1002616/1 |
Text MD5: | c6e9fa2f969ebd50fdd1491ef643e1c2 |
Author: | stefan |
Category: | eleu |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-02-05 20:57:40 |
Source code size: | 695 bytes / 35 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 817 / 754 |
Referenced in: | [show references] |