Пример #1
0
        public override bool AddCodeLine(string command, string line)
        {
            PositionableObject p = Object as PositionableObject;

            if (p == null)
            {
                return(base.AddCodeLine(command, line));
            }

            if (command == "NAME")
            {
                Object.Name = Reader.GetRestOfWords(line);
            }
            else if (command == "POSITION")
            {
                p.Position = Utilities.ReadVector3F(Reader.GetRestOfWords(line));
            }
            else if (command == "SIZE")
            {
                p.Size = Utilities.ReadVector3F(Reader.GetRestOfWords(line));
            }
            else if (command == "ROTATION")
            {
                float.TryParse(Reader.GetRestOfWords(line), out p.Rotation);
            }
            else
            {
                p.Attributes.Add(line);
            }

            return(true);
        }
Пример #2
0
        public override string BuildCode()
        {
            PositionableObject p = Object as PositionableObject;

            if (p == null)
            {
                return(base.BuildCode());
            }

            Code.Clear();
            if (p.Name != string.Empty)
            {
                AddCode(1, "name", p.Name);
            }

            AddCode(1, "position", p.Position);
            AddCode(1, "rotation", p.Rotation);
            AddCode(1, "size", p.Size);

            return(p.ObjectType);
        }
Пример #3
0
 public void Add(PositionableObject @object)
 {
     objectsToAdd.Add(@object);
 }
Пример #4
0
 public static void AddToTheMaze(PositionableObject entity)
 {
     entitiesInTheMaze.Add(entity);
 }
Пример #5
0
 public SimplePhysics(PositionableObject positionable, SimplePhysicsType type)
 {
     this.positionable = positionable;
     Type = type;
 }