package com.cocoachina.runningcube;

import java.util.Map;
import java.util.Iterator;

import com.unity3d.player.*;


public class Util {

    public static String MapToString(Map<String, String> map) {
        String result = "";
        Iterator<String> keySetIterator = map.keySet().iterator();
        while(keySetIterator.hasNext()) {
            String key = keySetIterator.next();
            result += "|" + key + ":" + map.get(key);
        }
        return result;
    }

    public static class MessageKey {
        public MessageKey(String unityObject, String message, String tag) {
            this.tag = tag;
            this.unityObject = unityObject;
            this.message = message;
        }
        private String unityObject;
        private String message;
        private String tag;

        public void Send(String content) {
            UnityPlayer.UnitySendMessage(this.unityObject, this.message, this.tag + "|" + content);
        }

    }
}
