using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class LoginProtocols
{
    public const short RequestLoginDetails = 100;
    public const short SendingLoginDetails = 101;
    public const short LoginSuccess = 102;
	public const short DetailSucess = 105;
    public const short LoginFail = 103;
    public const short SceneChange = 104;

    public class EmptyMsg : MessageBase { }

    public class LoginMsg : MessageBase
    {
        public string Name;
        public Color Color;
		public string Animal;

        public LoginMsg() { }

		public LoginMsg(string Name)
		{
			this.Name = Name;
		}

        public LoginMsg(string Name, Color Color, string Animal)
        {
            this.Name = Name;
            this.Color = Color;
			this.Animal = Animal;
        }

        public override void Serialize(NetworkWriter writer)
        {
            base.Serialize(writer);
            writer.Write(Name);
            writer.Write(Color);
			writer.Write(Animal);
        }

        public override void Deserialize(NetworkReader reader)
        {
            base.Deserialize(reader);
            Name = reader.ReadString();
            Color = reader.ReadColor();
			Animal = reader.ReadString();
        }
    }

    public class SceneMsg : MessageBase
    {

        public string Scene;
        public bool Additive;

        public SceneMsg() { }
        public SceneMsg(string Scene, bool Additive = false)
        {
            this.Scene = Scene;
            this.Additive = Additive;
        }

        public override void Serialize(NetworkWriter writer)
        {
            base.Serialize(writer);
            writer.Write(Scene);
        }

        public override void Deserialize(NetworkReader reader)
        {
            base.Deserialize(reader);
            Scene = reader.ReadString();
        }


    }
}


