internal CapturedWorldObject(WorldObject wo)
        {
            this.Id = wo.Id;
            this.Name = wo.Name;
            this.ObjectClass = wo.ObjectClass;

            this.Behavior = wo.Behavior;
            this.Category = wo.Category;
            this.Container = wo.Container;
            this.GameDataFlags1 = wo.GameDataFlags1;
            this.Icon = wo.Icon;
            this.LastIdTime = wo.LastIdTime;
            this.PhysicsDataFlags = wo.PhysicsDataFlags;
            this.Type = wo.Type;

            this.HasIdData = wo.HasIdData;

            this._coordinates = wo.Coordinates();
            this._orientation = wo.Orientation();
            this._offset = wo.Offset();
            this._rawCoordinates = wo.RawCoordinates();

            var tmpIntList = new List<int>();
            for (int i = 0; i < wo.ActiveSpellCount; i++)
            {
                tmpIntList.Add(wo.ActiveSpell(i));
            }

            this._activeSpells = General.ListOperations.Capture(tmpIntList).AsReadOnly();

            tmpIntList.Clear();
            for (int i = 0; i < wo.SpellCount; i++)
            {
                tmpIntList.Add(wo.Spell(i));
            }

            this._spells = General.ListOperations.Capture(tmpIntList).AsReadOnly();

            foreach (var key in wo.BoolKeys)
                _boolValues.Add(key, wo.Values((BoolValueKey)key));

            foreach (var key in wo.DoubleKeys)
                _doubleValues.Add(key, wo.Values((DoubleValueKey)key));

            foreach (var key in wo.LongKeys)
                this._longValues.Add(key, wo.Values((LongValueKey)key));

            foreach (var key in wo.StringKeys)
                _stringValues.Add(key, wo.Values((StringValueKey)key));
        }
Ejemplo n.º 2
0
        static Vector3Object[] MakeCircle(Vector3 position, float radius = 0)
        {
            int edgeCount = 6;

            Vector3Object[] points = new Vector3Object[edgeCount];
            radius += Utility.holeRadius;

            for (int i = 0; i < edgeCount; ++i)
            {
                float angle = ((float)i / (float)edgeCount) * 2 * Mathf.PI;
                points[i]   = new Vector3Object(position + new Vector3(Mathf.Cos(angle), 0, Mathf.Sin(angle)) * radius);
                points[i].y = TerrainHeight((float)points[i].x, (float)points[i].z);
            }

            return(points);
        }
Ejemplo n.º 3
0
    public static sCoord a(WorldObject A_0)
    {
        CoordsObject obj2 = A_0.Coordinates();

        if (obj2 == null)
        {
            return(sCoord.NoWhere);
        }
        Vector3Object obj3 = A_0.RawCoordinates();

        if (obj3 == null)
        {
            return(sCoord.NoWhere);
        }
        return(new sCoord {
            x = obj2.get_EastWest(), y = obj2.get_NorthSouth(), z = obj3.get_Z() / 240.0
        });
    }