Пример #1
0
        private String Show(Field obj)
        {
            Console.ForegroundColor = ConsoleColor.Gray;

            ContainerField item = obj as ContainerField;
            if(item != null)
            {
                if(item.Child is Baricade.Core.Movables.Baricade)
                {
                    return "B";
                }
                else if(item.Child is Pawn)
                {
                    var pawn = item.Child as Pawn;
                    Console.ForegroundColor = GetColor(pawn.OwnedBy.Number);
                    
                    return pawn.Number + "";
                }
            }
            
        string ShowField(Field obj)
            {
            return FieldToString.Convert(obj);
            
        }
Пример #2
0
        void AddBaricade(ContainerField b1)
        {
#if !NOBARICADE
            b1.Child            = new Movables.Baricade();
            b1.Child.StandingOn = b1;
#endif
        }
Пример #3
0
        public static int GetUpdateField(ContainerField containerField)
        {
            var typeString = string.Format("WowPacketParser.Enums.Version.{0}.ContainerField", ClientVersion.GetVersionString());

            var newEnumType = _assembly.GetType(typeString);

            foreach (int val in Enum.GetValues(newEnumType))
                if (Enum.GetName(newEnumType, val) == containerField.ToString())
                    return val;

            return (int)containerField;
        }
Пример #4
0
        public static int GetUpdateField(ContainerField containerField)
        {
            var typeString = string.Format("WowPacketParser.Enums.Version.{0}.ContainerField", ClientVersion.GetVersionString());

            var newEnumType = _assembly.GetType(typeString);

            foreach (int val in Enum.GetValues(newEnumType))
            {
                if (Enum.GetName(newEnumType, val) == containerField.ToString())
                {
                    return(val);
                }
            }

            return((int)containerField);
        }
Пример #5
0
 /*
  * Define a new local field. The type may be null, which
  * is equivalent to XType.OBJECT.
  */
 internal void DefLocalField(string name, XType ltype)
 {
     if (Auto)
     {
         ContainerField cf = new ContainerField(name, ltype);
         AddLocal(name,
                  new LocalAccessorInterpreterFieldGet(this, cf));
         AddLocal("->" + name,
                  new LocalAccessorInterpreterFieldPut(this, cf));
     }
     else
     {
         int off = numLocalFields++;
         fieldMapping.Add(off);
         AddLocal(name,
                  new LocalAccessorFieldGet(this, off));
         AddLocal("->" + name,
                  new LocalAccessorFieldPut(this, off, ltype));
     }
 }
Пример #6
0
        void CreateBoard(Game game)
        {
            var origin = new BottomField();

            origin.Row    = 1;
            origin.Column = 0;

            // Bottom Row
            BaseField first = CreateBottomRow(origin);

            // Spawn points
            CreateSpawnPoints(game, first);

            // Second Row
            BaseField second = CreateSecondRow(first);

            // Third Row
            BaseField third = CreateThridRow(second);

            // Fourth Row
            BaseField fourth = CreateFourthRow(third);

            // Fifth Row
            BaseField fifth = CreateFifthRow(fourth);

            // Sixth Row
            BaseField sixth = CreateSixthRow(fifth);

            // Seventh Row
            BaseField seventh = CreateSeventhRow(sixth);

            Finish = seventh.GetField(Direction.Right, 4)
                     .AddField(Direction.Up, new FinishField()).GetField(Direction.Up) as ContainerField;

            Origin = origin;
        }
Пример #7
0
 internal LocalAccessorInterpreterFieldPut(
     FunctionBuilder owner, ContainerField cf)
     : base(owner)
 {
     this.cf = cf;
 }