Ejemplo n.º 1
0
 public SceneObject()
 {
     Position  = new Vector();
     Rotation  = new AngAxis(1, 0, 0, 0);
     Scale     = new Vector(1, 1, 1);
     classname = "SceneObject";
 }
Ejemplo n.º 2
0
 public SceneObject(Vector position, AngAxis rotation, Vector scale)
 {
     Position  = position;
     Rotation  = rotation;
     Scale     = scale;
     classname = "SceneObject";
 }
Ejemplo n.º 3
0
 public GameBase()
 {
     Position  = new Vector();
     Rotation  = new AngAxis(1, 0, 0, 0);
     Scale     = new Vector();
     Datablock = "NULL";
     classname = "GameBase";
 }
Ejemplo n.º 4
0
 public GameBase(string datablock)
 {
     Position  = new Vector();
     Rotation  = new AngAxis(1, 0, 0, 0);
     Scale     = new Vector();
     Datablock = datablock;
     classname = "GameBase";
 }
Ejemplo n.º 5
0
        public string this[string field]
        {
            get
            {
                var fields = this.GetType().GetFields();
                if (fields.Select(a => a.Name).Contains(field))
                {
                    return(this.GetType().GetField(field).GetValue(this).ToString());
                }
                else
                {
                    if (dynamicFields.ContainsKey(field))
                    {
                        return(dynamicFields[field]);
                    }
                    else
                    {
                        return("");
                    }
                }
            }

            set
            {
                var fields = this.GetType().GetFields();
                if (fields.Select(a => a.Name.ToLower()).Contains(field.ToLower()))
                {
                    var thisfield = this.GetType().GetFields().First(a => a.Name.ToLower() == field.ToLower());
                    if (thisfield.FieldType == typeof(Boolean))
                    {
                        if (value == "0")
                        {
                            value = bool.FalseString;
                        }
                        if (value == "1")
                        {
                            value = bool.TrueString;
                        }
                    }
                    else
                    if (thisfield.FieldType == typeof(Vector))
                    {
                        var val = new Vector(value);
                        thisfield.SetValue(this, val);
                    }
                    else
                    if (thisfield.FieldType == typeof(AngAxis))
                    {
                        var val = new AngAxis(value);
                        thisfield.SetValue(this, val);
                    }
                    else
                    {
                        thisfield.SetValue(this, Convert.ChangeType(value, thisfield.FieldType));
                    }
                }
                else
                {
                    if (dynamicFields.ContainsKey(field))
                    {
                        dynamicFields[field] = value;
                    }
                    else
                    {
                        dynamicFields.Add(field, value);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public PathNode(Vector position,AngAxis rotation,Vector scale,string targetnode,string timetonext = "5000") : base("PathNode",position,rotation,scale)
 {
     this.targetnode = targetnode;
     this.timetonext = timetonext;
 }
Ejemplo n.º 7
0
 public GameBase(Vector position, AngAxis rotation, Vector scale, string datablock) : base(position, rotation, scale)
 {
     Datablock = datablock;
     classname = "GameBase";
 }