예제 #1
0
        // If success, return generated CharacterId
        public static async Task <int> CreateCharacter(ICharacter character, int userId)
        {
            Webservice webservice  = new Webservice(BASE_URL);
            String     methodRoute = "/";
            JObject    jObject     = new JObject();

            if (character is Warrior)
            {
                jObject = await webservice.HttpClientSenderJObject(CHARACTER_URL + methodRoute + userId, character as Warrior);
            }
            else if (character is Hunter)
            {
                jObject = await webservice.HttpClientSenderJObject(CHARACTER_URL + methodRoute + userId, character as Hunter);
            }
            else if (character is Magus)
            {
                jObject = await webservice.HttpClientSenderJObject(CHARACTER_URL + methodRoute + userId, character as Magus);
            }
            JToken value = jObject.First;

            return(value.ToObject <int>());
        }
예제 #2
0
        // If success, return generated GearId
        public static async Task <int> CreateGear(Gear gear, int gearBaseId)
        {
            Webservice webservice  = new Webservice(BASE_URL);
            String     methodRoute = "/";
            JObject    jObject     = new JObject();

            jObject = await webservice.HttpClientSenderJObject(GEAR_URL + methodRoute + gearBaseId, gear);

            JToken value  = jObject.First;
            int    result = value.ToObject <int>();

            return(result);
        }
예제 #3
0
        // If success, return generated UsableId
        public static async Task <int> CreateUsable(Stats stats, int usableBaseId)
        {
            Webservice webservice  = new Webservice(BASE_URL);
            String     methodRoute = "/";
            JObject    jObject     = new JObject();

            jObject = await webservice.HttpClientSenderJObject(USABLE_URL + methodRoute + usableBaseId, stats);

            JToken value  = jObject.First;
            int    result = value.ToObject <int>();

            return(result);
        }