aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/LandData.cs
blob: f793213d2bc9ad7e94975917ba7ba493e019621f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
/*
 * Copyright (c) Contributors, http://opensimulator.org/
 * See CONTRIBUTORS.TXT for a full list of copyright holders.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the OpenSimulator Project nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

using System;
using System.Collections.Generic;
using OpenMetaverse;

namespace OpenSim.Framework
{
    public class LandData
    {
        private Vector3 _AABBMax = new Vector3();
        private Vector3 _AABBMin = new Vector3();
        private int _area = 0;
        private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned
        private UUID _authBuyerID = UUID.Zero; //Unemplemented. Authorized Buyer's UUID
        private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
        private int _claimDate = 0;
        private int _claimPrice = 0; //Unemplemented
        private UUID _globalID = UUID.Zero;
        private UUID _groupID = UUID.Zero;
        private int _groupPrims = 0;
        private bool _isGroupOwned = false;
        private byte[] _bitmap = new byte[512];
        private string _description = String.Empty;


        private uint _flags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark |
                                (uint) Parcel.ParcelFlags.AllowAPrimitiveEntry |
                                (uint) Parcel.ParcelFlags.AllowDeedToGroup | (uint) Parcel.ParcelFlags.AllowTerraform |
                                (uint) Parcel.ParcelFlags.CreateObjects | (uint) Parcel.ParcelFlags.AllowOtherScripts |
                                (uint) Parcel.ParcelFlags.SoundLocal;

        private byte _landingType = 0;
        private string _name = "Your Parcel";
        private Parcel.ParcelStatus _status = Parcel.ParcelStatus.Leased;
        private int _localID = 0;
        private byte _mediaAutoScale = 0;
        private UUID _mediaID = UUID.Zero;

        private string _mediaURL = String.Empty;
        private string _musicURL = String.Empty;
        private int _otherPrims = 0;
        private UUID _ownerID = UUID.Zero;
        private int _ownerPrims = 0;
        private List<ParcelManager.ParcelAccessEntry> _parcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
        private float _passHours = 0;
        private int _passPrice = 0;
        private int _salePrice = 0; //Unemeplemented. Parcels price.
        private int _selectedPrims = 0;
        private int _simwideArea = 0;
        private int _simwidePrims = 0;
        private UUID _snapshotID = UUID.Zero;
        private Vector3 _userLocation = new Vector3();
        private Vector3 _userLookAt = new Vector3();
        private int _dwell = 0;
        private int _otherCleanTime = 0;

        public Vector3 AABBMax {
            get {
                return _AABBMax;
            }
            set {
                _AABBMax = value;
            }
        }

        public Vector3 AABBMin {
            get {
                return _AABBMin;
            }
            set {
                _AABBMin = value;
            }
        }

        public int Area {
            get {
                return _area;
            }
            set {
                _area = value;
            }
        }

        public uint AuctionID {
            get {
                return _auctionID;
            }
            set {
                _auctionID = value;
            }
        }

        public UUID AuthBuyerID {
            get {
                return _authBuyerID;
            }
            set {
                _authBuyerID = value;
            }
        }

        public Parcel.ParcelCategory Category {
            get {
                return _category;
            }
            set {
                _category = value;
            }
        }

        public int ClaimDate {
            get {
                return _claimDate;
            }
            set {
                _claimDate = value;
            }
        }

        public int ClaimPrice {
            get {
                return _claimPrice;
            }
            set {
                _claimPrice = value;
            }
        }

        public UUID GlobalID {
            get {
                return _globalID;
            }
            set {
                _globalID = value;
            }
        }

        public UUID GroupID {
            get {
                return _groupID;
            }
            set {
                _groupID = value;
            }
        }

        public int GroupPrims {
            get {
                return _groupPrims;
            }
            set {
                _groupPrims = value;
            }
        }

        public bool IsGroupOwned {
            get {
                return _isGroupOwned;
            }
            set {
                _isGroupOwned = value;
            }
        }

        public byte[] Bitmap {
            get {
                return _bitmap;
            }
            set {
                _bitmap = value;
            }
        }

        public string Description {
            get {
                return _description;
            }
            set {
                _description = value;
            }
        }

        public uint Flags {
            get {
                return _flags;
            }
            set {
                _flags = value;
            }
        }

        public byte LandingType {
            get {
                return _landingType;
            }
            set {
                _landingType = value;
            }
        }

        public string Name {
            get {
                return _name;
            }
            set {
                _name = value;
            }
        }

        public Parcel.ParcelStatus Status {
            get {
                return _status;
            }
            set {
                _status = value;
            }
        }

        public int LocalID {
            get {
                return _localID;
            }
            set {
                _localID = value;
            }
        }

        public byte MediaAutoScale {
            get {
                return _mediaAutoScale;
            }
            set {
                _mediaAutoScale = value;
            }
        }

        public UUID MediaID {
            get {
                return _mediaID;
            }
            set {
                _mediaID = value;
            }
        }

        public string MediaURL {
            get {
                return _mediaURL;
            }
            set {
                _mediaURL = value;
            }
        }

        public string MusicURL {
            get {
                return _musicURL;
            }
            set {
                _musicURL = value;
            }
        }

        public int OtherPrims {
            get {
                return _otherPrims;
            }
            set {
                _otherPrims = value;
            }
        }

        public UUID OwnerID {
            get {
                return _ownerID;
            }
            set {
                _ownerID = value;
            }
        }

        public int OwnerPrims {
            get {
                return _ownerPrims;
            }
            set {
                _ownerPrims = value;
            }
        }

        public List<ParcelManager.ParcelAccessEntry> ParcelAccessList {
            get {
                return _parcelAccessList;
            }
            set {
                _parcelAccessList = value;
            }
        }

        public float PassHours {
            get {
                return _passHours;
            }
            set {
                _passHours = value;
            }
        }

        public int PassPrice {
            get {
                return _passPrice;
            }
            set {
                _passPrice = value;
            }
        }

        public int SalePrice {
            get {
                return _salePrice;
            }
            set {
                _salePrice = value;
            }
        }

        public int SelectedPrims {
            get {
                return _selectedPrims;
            }
            set {
                _selectedPrims = value;
            }
        }

        public int SimwideArea {
            get {
                return _simwideArea;
            }
            set {
                _simwideArea = value;
            }
        }

        public int SimwidePrims {
            get {
                return _simwidePrims;
            }
            set {
                _simwidePrims = value;
            }
        }

        public UUID SnapshotID {
            get {
                return _snapshotID;
            }
            set {
                _snapshotID = value;
            }
        }

        public Vector3 UserLocation {
            get {
                return _userLocation;
            }
            set {
                _userLocation = value;
            }
        }

        public Vector3 UserLookAt {
            get {
                return _userLookAt;
            }
            set {
                _userLookAt = value;
            }
        }

        public int Dwell {
            get {
                return _dwell;
            }
            set {
                _dwell = value;
            }
        }

        public int OtherCleanTime {
            get {
                return _otherCleanTime;
            }
            set {
                _otherCleanTime = value;
            }
        }

        public LandData()
        {
            _globalID = UUID.Random();
        }

        public LandData Copy()
        {
            LandData landData = new LandData();

            landData._AABBMax = _AABBMax;
            landData._AABBMin = _AABBMin;
            landData._area = _area;
            landData._auctionID = _auctionID;
            landData._authBuyerID = _authBuyerID;
            landData._category = _category;
            landData._claimDate = _claimDate;
            landData._claimPrice = _claimPrice;
            landData._globalID = _globalID;
            landData._groupID = _groupID;
            landData._groupPrims = _groupPrims;
            landData._otherPrims = _otherPrims;
            landData._ownerPrims = _ownerPrims;
            landData._selectedPrims = _selectedPrims;
            landData._isGroupOwned = _isGroupOwned;
            landData._localID = _localID;
            landData._landingType = _landingType;
            landData._mediaAutoScale = _mediaAutoScale;
            landData._mediaID = _mediaID;
            landData._mediaURL = _mediaURL;
            landData._musicURL = _musicURL;
            landData._ownerID = _ownerID;
            landData._bitmap = (byte[]) _bitmap.Clone();
            landData._description = _description;
            landData._flags = _flags;
            landData._name = _name;
            landData._status = _status;
            landData._passHours = _passHours;
            landData._passPrice = _passPrice;
            landData._salePrice = _salePrice;
            landData._snapshotID = _snapshotID;
            landData._userLocation = _userLocation;
            landData._userLookAt = _userLookAt;
            landData._otherCleanTime = _otherCleanTime;
            landData._dwell = _dwell;

            landData._parcelAccessList.Clear();
            foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
            {
                ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
                newEntry.AgentID = entry.AgentID;
                newEntry.Flags = entry.Flags;
                newEntry.Time = entry.Time;

                landData._parcelAccessList.Add(newEntry);
            }

            return landData;
        }
    }
}