public DType Accept(TBool type, ExcelStream x)
        {
            var d = x.Read();

            if (CheckNull(type.IsNullable, d))
            {
                return(null);
            }
            return(DBool.ValueOf(CreateBool(d)));
        }
Example #2
0
 public DType Accept(TBool type, string x)
 {
     if (bool.TryParse(x, out var b))
     {
         return(DBool.ValueOf(b));
     }
     else
     {
         throw new Exception($"{x} 不是bool类型");
     }
 }
Example #3
0
        public Hero()
        {
            this.Speed        = 10;
            this.health       = new DInt(Rand.Next(4, 10));
            this.evil         = new DBool();
            this.kind         = new DByte();
            this.attacking    = new DBool();
            this.attackSpeed  = new DByte((byte)Rand.Next(5, 12));
            this.attackDamage = new DByte((byte)Rand.Next(1, 4));

            this.type = 10;
        }
Example #4
0
        public Hero()
        {
            this.Speed = 10;
            this.health = new DInt(Rand.Next(4,10));
            this.evil = new DBool();
            this.kind = new DByte();
            this.attacking = new DBool();
            this.attackSpeed = new DByte((byte)Rand.Next(5,12));
            this.attackDamage = new DByte((byte)Rand.Next(1,4));

            this.type = 10;
        }
Example #5
0
 public DType Accept(TBool type, XElement x, DefAssembly ass)
 {
     return(DBool.ValueOf(bool.Parse(x.Value.Trim().ToLower())));
 }
Example #6
0
 public void Accept(DBool type, DefField x, List <ResourceInfo> y)
 {
     throw new NotImplementedException();
 }
Example #7
0
 public Character(User user)
 {
     this.owner = user;
     this.enabled = new DBool();
     this.Speed = 3;
 }
 public int Accept(DBool data, TType type, Title x)
 {
     SetTitleValue(x, data.Value);
     return(1);
 }
Example #9
0
 public bool Accept(DBool type)
 {
     return(type.Value == false);
 }
Example #10
0
 public void Accept(DBool type, Utf8JsonWriter x)
 {
     x.WriteBooleanValue(type.Value);
 }
Example #11
0
 public string Accept(DBool type)
 {
     return(type.Value ? "true" : "false");
 }
 public DType Accept(TBool type, object x, DefAssembly ass)
 {
     return(DBool.ValueOf((bool)x));
 }
Example #13
0
 public void Accept(DBool type, DefAssembly x)
 {
     throw new NotImplementedException();
 }
Example #14
0
 public void Accept(DBool type, StringBuilder line)
 {
     line.Append(type.Value ? "true" : "false");
 }
Example #15
0
 public Character(User user)
 {
     this.owner   = user;
     this.enabled = new DBool();
     this.Speed   = 3;
 }
Example #16
0
 public void Accept(DBool type, ByteBuf x)
 {
     x.WriteBool(type.Value);
 }
Example #17
0
 public void Accept(DBool type, RawTextTable x)
 {
 }
Example #18
0
 public DBool OpAND(DBool other)
 {
     return(new DBool(value && other.value));
 }
 public void Accept(DBool type, TType x, List <ResourceInfo> y)
 {
 }
Example #20
0
 public DBool OpOR(DBool other)
 {
     return(new DBool(value || other.value));
 }
Example #21
0
 public void Accept(DBool type, StringBuilder x)
 {
     x.Append(type.Value);
 }
Example #22
0
 public DType Accept(TBool type, JsonElement x, DefAssembly ass)
 {
     return(DBool.ValueOf(x.GetBoolean()));
 }