mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
27 lines
647 B
JavaScript
27 lines
647 B
JavaScript
|
/**
|
||
|
* Created by knut on 14-11-19.
|
||
|
*/
|
||
|
var actors = {};
|
||
|
var messages = [];
|
||
|
exports.addActor = function(id,name,description){
|
||
|
//console.log('Adding actor: '+id);
|
||
|
actors[id] = {name:name, description:description};
|
||
|
};
|
||
|
|
||
|
exports.addMessage = function(idFrom, idTo, message, answer){
|
||
|
//console.log('Adding message from='+idFrom+' to='+idTo+' message='+message+' answer='+answer);
|
||
|
messages.push({from:idFrom, to:idTo, message:message, answer:answer});
|
||
|
};
|
||
|
|
||
|
exports.getMessages = function(){
|
||
|
return messages;
|
||
|
};
|
||
|
|
||
|
exports.getActors = function(){
|
||
|
return actors;
|
||
|
};
|
||
|
|
||
|
exports.clear = function(){
|
||
|
actors = {};
|
||
|
messages = [];
|
||
|
};
|