Ejemplo n.º 1
0
        public static Block HandleBlock(ushort id, List <object> data, ref int index)
        {
            ExtraBlockData bd = null;

            if (data != null)
            {
                switch (id)
                {
                case (ushort)BlockId.SignWood:
                case (ushort)BlockId.SignRed:
                case (ushort)BlockId.SignGreen:
                case (ushort)BlockId.SignBlue:
                    bd = SignBlockData.Deserialize(data, ref index);
                    break;

                case (ushort)BlockId.Portal:
                    bd = PortalBlockData.Deserialize(data, ref index);
                    break;

                case (ushort)BlockId.EffectMultiJump:
                case (ushort)BlockId.EffectHighJump:
                    bd = EffectBlockData.Deserialize(data, ref index);
                    break;

                case (ushort)BlockId.SwitchLocal:
                case (ushort)BlockId.SwitchLocalReset:
                case (ushort)BlockId.SwitchGlobal:
                case (ushort)BlockId.SwitchGlobalReset:
                    bd = SwitchBlockData.Deserialize(data, ref index, false);
                    break;

                case (ushort)BlockId.SwitchGlobalDoor:
                case (ushort)BlockId.SwitchLocalDoor:
                case (ushort)BlockId.CoinGoldDoor:
                case (ushort)BlockId.CoinBlueDoor:
                    bd = SwitchBlockData.Deserialize(data, ref index, true);
                    break;

                case (ushort)BlockId.Platform:
                case (ushort)BlockId.JunglePlatform:
                    bd = PlatformBlockData.Deserialize(data, ref index);
                    break;
                }
            }
            return(new Block(id, bd));
        }
Ejemplo n.º 2
0
 public Block(ushort id = 0, int playerId = 0, ExtraBlockData data = null)
 {
     this.Id       = id;
     this.PlayerId = playerId;
     this.Data     = data;
 }
Ejemplo n.º 3
0
 public Block(ushort id = 0, ExtraBlockData data = null) : this(id, 0, data)
 {
 }
Ejemplo n.º 4
0
 public Block(BlockId id = 0, int playerId = 0, ExtraBlockData data = null) : this((ushort)id, playerId, data)
 {
 }
Ejemplo n.º 5
0
 public Block(BlockId id = 0, ExtraBlockData data = null) : this((ushort)id, 0, data)
 {
 }