Beispiel #1
0
 public void OnDeserialization()
 {
     foreach (TrileEmplacement index in this.Triles.Keys)
     {
         TrileInstance trileInstance1 = this.Triles[index];
         if (this.Triles[index].Emplacement != index)
         {
             this.Triles[index].Emplacement = index;
         }
         trileInstance1.Update();
         trileInstance1.OriginalEmplacement = index;
         if (trileInstance1.Overlaps)
         {
             foreach (TrileInstance trileInstance2 in trileInstance1.OverlappedTriles)
             {
                 trileInstance2.OriginalEmplacement = index;
             }
         }
     }
     foreach (int index in this.Scripts.Keys)
     {
         this.Scripts[index].Id = index;
     }
     foreach (int index in this.Volumes.Keys)
     {
         this.Volumes[index].Id = index;
     }
     foreach (int index in this.NonPlayerCharacters.Keys)
     {
         this.NonPlayerCharacters[index].Id = index;
     }
     foreach (int index in this.ArtObjects.Keys)
     {
         this.ArtObjects[index].Id = index;
     }
     foreach (int index in this.BackgroundPlanes.Keys)
     {
         this.BackgroundPlanes[index].Id = index;
     }
     foreach (int index in this.Paths.Keys)
     {
         this.Paths[index].Id = index;
     }
     foreach (int index1 in this.Groups.Keys)
     {
         TrileGroup trileGroup = this.Groups[index1];
         trileGroup.Id = index1;
         TrileEmplacement[] trileEmplacementArray = new TrileEmplacement[trileGroup.Triles.Count];
         for (int index2 = 0; index2 < trileEmplacementArray.Length; ++index2)
         {
             trileEmplacementArray[index2] = trileGroup.Triles[index2].Emplacement;
         }
         trileGroup.Triles.Clear();
         foreach (TrileEmplacement index2 in trileEmplacementArray)
         {
             trileGroup.Triles.Add(this.Triles[index2]);
         }
     }
 }
Beispiel #2
0
 public TrileInstance(Vector3 position, int trileId)
     : this()
 {
     this.data.PositionPhi  = new Vector4(position, 0.0f);
     this.cachedPosition    = position;
     this.cachedEmplacement = new TrileEmplacement(position);
     this.Update();
     this.TrileId = trileId;
     this.RefreshTrile();
 }
Beispiel #3
0
        public CollisionType GetRotatedFace(FaceOrientation face)
        {
            FaceOrientation index         = FezMath.OrientationFromPhi(FezMath.ToPhi(face) - this.Phi);
            CollisionType   collisionType = this.Trile.Faces[index];

            if (collisionType == CollisionType.TopOnly)
            {
                TrileEmplacement emplacement = this.Emplacement;
                ++emplacement.Y;
                Vector3       mask = FezMath.GetMask(FezMath.AsAxis(face));
                TrileInstance trileInstance;
                if (TrileInstance.LevelManager.Triles.TryGetValue(emplacement, out trileInstance) && trileInstance.Enabled && !trileInstance.IsMovingGroup && (trileInstance.Trile.Geometry == null || !trileInstance.Trile.Geometry.Empty || trileInstance.Trile.Faces[index] != CollisionType.None) && (!trileInstance.Trile.Immaterial && trileInstance.Trile.Faces[index] != CollisionType.Immaterial && (!trileInstance.Trile.Thin && !ActorTypeExtensions.IsPickable(trileInstance.Trile.ActorSettings.Type)) && (((double)trileInstance.Trile.Size.Y == 1.0 || trileInstance.ForceTopMaybe) && FezMath.AlmostEqual(FezMath.Dot(trileInstance.Center, mask), FezMath.Dot(this.Center, mask)))))
                {
                    collisionType = CollisionType.None;
                }
            }
            return(collisionType);
        }
Beispiel #4
0
 private void AddDownforce(TrileInstance instance, float factor, bool apply, bool propagate)
 {
   if (instance == null || instance.TrileId != 286)
     return;
   BridgeState bridgeState;
   if (!this.ActiveBridgeParts.TryGetValue(instance, out bridgeState))
     this.ActiveBridgeParts.Add(instance, bridgeState = new BridgeState(instance));
   else if (apply && bridgeState.Dirty)
     return;
   Vector3 vector3 = FezMath.SideMask(this.CameraManager.Viewpoint);
   if (apply)
   {
     bridgeState.Downforce = MathHelper.Clamp(bridgeState.Downforce + factor, 0.0f, 1f);
     bridgeState.Dirty = true;
   }
   if (!propagate)
     return;
   TrileEmplacement id = new TrileEmplacement(bridgeState.OriginalPosition - vector3);
   this.AddDownforce(this.LevelManager.TrileInstanceAt(ref id), factor / 2f, true, true);
   id = new TrileEmplacement(bridgeState.OriginalPosition + vector3);
   this.AddDownforce(this.LevelManager.TrileInstanceAt(ref id), factor / 2f, true, true);
 }
Beispiel #5
0
 public void Update(TimeSpan elapsed)
 {
   if (!this.Enabled)
     return;
   BoundingFrustum boundingFrustum = this.CameraManager.Frustum;
   if (!this.effect.ForcedViewProjection.HasValue)
   {
     Vector3 position = this.CameraManager.Position;
     Vector3 center = this.CameraManager.Center;
     this.BillboardingPhi = (float) Math.Atan2((double) position.X - (double) center.X, (double) position.Z - (double) center.Z);
   }
   else
     boundingFrustum = this.cachedFrustum;
   if ((double) this.settings.SystemLifetime != 0.0)
   {
     this.age += elapsed;
     if (this.age.TotalSeconds > (double) this.settings.SystemLifetime)
     {
       this.Enabled = false;
       this.Visible = false;
       this.Dead = true;
       foreach (PlaneParticleSystem.Particle particle in this.activeParticles)
         this.particles.Return(particle);
       this.activeParticles.Clear();
       return;
     }
   }
   if (this.FadingOut)
   {
     this.SinceFadingOut += (float) elapsed.TotalSeconds;
     this.FadeOutAge = FezMath.Saturate(this.SinceFadingOut / this.FadeOutDuration);
     if ((double) this.FadeOutAge >= 1.0)
     {
       this.Enabled = false;
       this.Visible = false;
       this.Dead = true;
       foreach (PlaneParticleSystem.Particle particle in this.activeParticles)
         this.particles.Return(particle);
       this.activeParticles.Clear();
       return;
     }
   }
   if (!this.InScreen)
     return;
   this.sinceSpawned -= elapsed;
   bool flag = this.untilNextSpawn.Ticks > 0L;
   this.untilNextSpawn -= elapsed;
   while (this.sinceSpawned.Ticks <= 0L || flag && this.untilNextSpawn.Ticks <= 0L)
   {
     if (flag && this.untilNextSpawn.Ticks <= 0L)
     {
       for (int index = 0; index < this.settings.SpawnBatchSize; ++index)
       {
         if (this.particles.Available > 0)
         {
           PlaneParticleSystem.Particle particle = this.particles.Take();
           particle.Initialize(this);
           this.activeParticles.Add(particle);
         }
       }
       flag = false;
     }
     if (this.sinceSpawned.Ticks <= 0L)
       this.PrepareNextSpawn();
   }
   int val1 = -1;
   float elapsedSeconds = (float) elapsed.TotalSeconds;
   int num1 = !this.HalfUpdate || !this.halfToProcess ? 0 : this.activeParticles.Count / 2;
   int num2 = !this.HalfUpdate || this.halfToProcess ? this.activeParticles.Count : this.activeParticles.Count / 2;
   for (int index = num1; index < num2; ++index)
   {
     PlaneParticleSystem.Particle particle = this.activeParticles[index];
     particle.Update(elapsedSeconds);
     if (this.Settings.UseCallback && !particle.DeathProvoked)
     {
       Vector3 vector3 = particle.Position;
       TrileEmplacement id = new TrileEmplacement((int) vector3.X, (int) vector3.Y, (int) vector3.Z);
       if (this.LevelManager.IsInRange(ref id))
       {
         TrileInstance trileInstance = this.LevelManager.TrileInstanceAt(ref id);
         if (trileInstance != null && trileInstance.Enabled && (!trileInstance.Trile.Immaterial && boundingFrustum.Contains(trileInstance.Center) != ContainmentType.Disjoint))
         {
           this.CollisionCallback(particle.Position * FezMath.XZMask + trileInstance.Center * Vector3.UnitY + trileInstance.Trile.Size.Y / 2f * Vector3.UnitY);
           particle.ProvokeDeath();
         }
       }
     }
     if (particle.Dead)
     {
       particle.Hide();
       this.activeParticles.RemoveAt(index);
       --index;
       --num2;
       this.particles.Return(particle);
     }
     else
       val1 = Math.Max(val1, particle.InstanceIndex);
   }
   this.Geometry.InstanceCount = val1;
 }
Beispiel #6
0
 public TrileFace() {
     Id = new TrileEmplacement();
 }
Beispiel #7
0
 public void OnDeserialization()
 {
   foreach (TrileEmplacement index in this.Triles.Keys)
   {
     TrileInstance trileInstance1 = this.Triles[index];
     if (this.Triles[index].Emplacement != index)
       this.Triles[index].Emplacement = index;
     trileInstance1.Update();
     trileInstance1.OriginalEmplacement = index;
     if (trileInstance1.Overlaps)
     {
       foreach (TrileInstance trileInstance2 in trileInstance1.OverlappedTriles)
         trileInstance2.OriginalEmplacement = index;
     }
   }
   foreach (int index in this.Scripts.Keys)
     this.Scripts[index].Id = index;
   foreach (int index in this.Volumes.Keys)
     this.Volumes[index].Id = index;
   foreach (int index in this.NonPlayerCharacters.Keys)
     this.NonPlayerCharacters[index].Id = index;
   foreach (int index in this.ArtObjects.Keys)
     this.ArtObjects[index].Id = index;
   foreach (int index in this.BackgroundPlanes.Keys)
     this.BackgroundPlanes[index].Id = index;
   foreach (int index in this.Paths.Keys)
     this.Paths[index].Id = index;
   foreach (int index1 in this.Groups.Keys)
   {
     TrileGroup trileGroup = this.Groups[index1];
     trileGroup.Id = index1;
     TrileEmplacement[] trileEmplacementArray = new TrileEmplacement[trileGroup.Triles.Count];
     for (int index2 = 0; index2 < trileEmplacementArray.Length; ++index2)
       trileEmplacementArray[index2] = trileGroup.Triles[index2].Emplacement;
     trileGroup.Triles.Clear();
     foreach (TrileEmplacement index2 in trileEmplacementArray)
       trileGroup.Triles.Add(this.Triles[index2]);
   }
 }
Beispiel #8
0
 private void DestroyNeighborhood(TrileInstance instance, BombsHost.BombState state)
 {
   Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint);
   Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint);
   bool flag1 = (double) vector3_1.X != 0.0;
   bool flag2 = flag1;
   int num = flag2 ? (int) vector3_2.Z : (int) vector3_2.X;
   Point point1 = new Point(flag1 ? instance.Emplacement.X : instance.Emplacement.Z, instance.Emplacement.Y);
   Point[] pointArray = instance.Trile.ActorSettings.Type == ActorType.BigBomb ? BombsHost.BigBombOffsets : BombsHost.SmallBombOffsets;
   this.LevelManager.WaitForScreenInvalidation();
   foreach (Point point2 in pointArray)
   {
     bool chainsploded = false;
     bool needsRecull = false;
     Point key = new Point(point1.X + point2.X, point1.Y + point2.Y);
     Limit limit;
     if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit))
     {
       limit.End += num;
       TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X);
       while ((flag2 ? id.Z : id.X) != limit.End)
       {
         TrileInstance nearestNeighbor = this.LevelManager.TrileInstanceAt(ref id);
         if (!this.TryExplodeAt(state, nearestNeighbor, ref chainsploded, ref needsRecull))
         {
           if (flag2)
             id.Z += num;
           else
             id.X += num;
         }
         else
           break;
       }
       if (needsRecull)
       {
         this.LevelManager.RecullAt(id);
         this.TrixelParticleSystems.UnGroundAll();
       }
     }
   }
 }
Beispiel #9
0
 public TrileInstance(Vector3 position, int trileId)
   : this()
 {
   this.data.PositionPhi = new Vector4(position, 0.0f);
   this.cachedPosition = position;
   this.cachedEmplacement = new TrileEmplacement(position);
   this.Update();
   this.TrileId = trileId;
   this.RefreshTrile();
 }
Beispiel #10
0
        public TrileInstance CreateNewTrile(int trileId, TrileEmplacement emplacement) {
            TrileInstance trile = new TrileInstance(emplacement, trileId);
            LevelManager.Triles[emplacement] = trile;

            if (CameraManager.Viewpoint.IsOrthographic()) {
                trile.SetPhiLight(CameraManager.Viewpoint.ToPhi());
            } else {
                //TODO get closest viewpoint... somehow.
            }

            trile.PhysicsState = new InstancePhysicsState(trile) {
                Respawned = true,
                Vanished = false
            };
            trile.Enabled = true;

            return trile;
        }
Beispiel #11
0
 public static void Write(this CrcWriter writer, TrileEmplacement s)
 {
   writer.Write(s.X);
   writer.Write(s.Y);
   writer.Write(s.Z);
 }
Beispiel #12
0
 private void StartCrumbling()
 {
   SoundEffectExtensions.EmitAt(this.Host.sCrumble, this.OriginalCenter, RandomHelper.Centered(0.00999999977648258));
   Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint);
   Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint);
   bool flag1 = (double) vector3_1.X != 0.0;
   bool flag2 = flag1;
   int num = flag2 ? (int) vector3_2.Z : (int) vector3_2.X;
   Point key = new Point(flag1 ? this.Instance.Emplacement.X : this.Instance.Emplacement.Z, this.Instance.Emplacement.Y);
   this.LevelManager.WaitForScreenInvalidation();
   Limit limit;
   if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit))
   {
     limit.End += num;
     TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X);
     while ((flag2 ? id.Z : id.X) != limit.End)
     {
       TrileInstance toRemove = this.LevelManager.TrileInstanceAt(ref id);
       if (toRemove != null && !toRemove.Hidden && toRemove.Trile.ActorSettings.Type == ActorType.Crumbler)
       {
         toRemove.Hidden = true;
         this.LevelMaterializer.CullInstanceOut(toRemove);
         this.InstancesToClear.Add(toRemove);
         ITrixelParticleSystems particleSystems = this.ParticleSystems;
         CrumblersHost.CrumblerState crumblerState = this;
         Game game = ServiceHelper.Game;
         TrixelParticleSystem.Settings settings = new TrixelParticleSystem.Settings()
         {
           BaseVelocity = Vector3.Zero,
           Energy = 0.1f,
           ParticleCount = (int) (20.0 / (double) this.InstancesToClear.Count),
           GravityModifier = 0.6f,
           Crumble = true,
           ExplodingInstance = toRemove
         };
         TrixelParticleSystem trixelParticleSystem1;
         TrixelParticleSystem trixelParticleSystem2 = trixelParticleSystem1 = new TrixelParticleSystem(game, settings);
         crumblerState.System = trixelParticleSystem1;
         TrixelParticleSystem system = trixelParticleSystem2;
         particleSystems.Add(system);
       }
       if (flag2)
         id.Z += num;
       else
         id.X += num;
     }
   }
   Waiters.Wait(1.0, new Action(this.ClearTriles)).AutoPause = true;
 }
Beispiel #13
0
 private void AddSupportedTrilesOver(TrileInstance instance)
 {
   TrileEmplacement id = new TrileEmplacement(instance.Emplacement.X, instance.Emplacement.Y + 1, instance.Emplacement.Z);
   TrileInstance instance1 = this.LevelManager.TrileInstanceAt(ref id);
   if (instance1 == null)
     return;
   this.AddSupportedTrile(instance1);
   if (!instance1.Overlaps)
     return;
   foreach (TrileInstance instance2 in instance1.OverlappedTriles)
     this.AddSupportedTrile(instance2);
 }
Beispiel #14
0
 public TrileInstance(TrileEmplacement emplacement, int trileId)
     : this(emplacement.AsVector, trileId)
 {
 }
Beispiel #15
0
 public TrileFace()
 {
     this.Id = new TrileEmplacement();
 }
Beispiel #16
0
        public override void Update(GameTime gameTime) {
            while (Scheduled.Count > 0) {
                Scheduled[0]();
                Scheduled.RemoveAt(0);
            }

            if ((--SkipLoading) == 0) {
                GameState.Loading = false;
                return;
            }

            if (GameState.Loading || GameState.InMap || GameState.InMenuCube || GameState.Paused || string.IsNullOrEmpty(LevelManager.Name)) {
                return;
            }

            if (ThumbnailScheduled) {
                if (ThumbnailRT == null) {
                    ThumbnailRT = TRM.TakeTarget();
                    TRM.ScheduleHook(DrawOrder, ThumbnailRT.Target);
                }
                return;
            }

            SinceMouseMoved += (float) gameTime.ElapsedGameTime.TotalSeconds;
            if (MouseState.Movement.X != 0 || MouseState.Movement.Y != 0) {
                SinceMouseMoved = 0f;
            }

            TooltipWidget.Label = null;
            TooltipWidget.Position.X = MouseState.Position.X + 24f;
            TooltipWidget.Position.Y = MouseState.Position.Y;

            CursorHovering = false;

            Vector3 right = CameraManager.InverseView.Right;
            Vector3 up = CameraManager.InverseView.Up;
            Vector3 forward = CameraManager.InverseView.Forward;
            Ray ray = new Ray(GraphicsDevice.Viewport.Unproject(new Vector3(MouseState.Position.X, MouseState.Position.Y, 0.0f), CameraManager.Projection, CameraManager.View, Matrix.Identity), forward);
            float intersectionMin = float.MaxValue;

            HoveredTrile = null;
            //Ugly thread-safety workaround
            int trilesCount = LevelManager.Triles.Count;
            LevelManager.Triles.CopyTo(tmpTriles.Length < trilesCount ? (tmpTriles = new KeyValuePair<TrileEmplacement, TrileInstance>[trilesCount]) : tmpTriles, 0);
            for (int i = 0; i < trilesCount; i++) {
                TrileInstance trile = tmpTriles[i].Value;
                BoundingBox box = new BoundingBox(trile.Position, trile.Position + new Vector3(1f));
                float? intersection = ray.Intersects(box);
                if (intersection.HasValue && intersection < intersectionMin) {
                    HoveredTrile = trile;
                    HoveredBox = box;
                    intersectionMin = intersection.Value;
                }
            }

            HoveredAO = null;
            if (LevelEditorOptions.Instance.TooltipArtObjectInfo) {
                int aosCount = LevelManager.ArtObjects.Count;
                LevelManager.ArtObjects.CopyTo(tmpAOs.Length < aosCount ? (tmpAOs = new KeyValuePair<int, ArtObjectInstance>[aosCount]) : tmpAOs, 0);
                for (int i = 0; i < aosCount; i++) {
                    ArtObjectInstance ao = tmpAOs[i].Value;
                    float? intersection = ray.Intersects(ao.Bounds);
                    if (intersection.HasValue && intersection < intersectionMin) {
                        HoveredTrile = null;
                        HoveredAO = ao;
                        HoveredBox = ao.Bounds;
                        intersectionMin = intersection.Value;
                    }
                }
            }

            if (HoveredAO != null) {
                TooltipWidget.Label = HoveredAO.Id + ": " + HoveredAO.ArtObjectName;
            }

            TrilePickerWidget.Position.Y = GraphicsDevice.Viewport.Height - TrilePickerWidget.Size.Y;
            InfoWidget.Position.Y = TrilePickerWidget.Position.Y - InfoWidget.Size.Y;

            bool cursorInMenu = UpdateWidgets(gameTime, Widgets, true);

            if (DraggingWidget != null && (MouseState.LeftButton.State == MouseButtonStates.Dragging || MouseState.LeftButton.State == MouseButtonStates.DragEnded)) {
                DraggingWidget.Dragging(gameTime, MouseState.LeftButton.State);
                cursorInMenu = true;

                if (MouseState.LeftButton.State == MouseButtonStates.DragEnded) {
                    DraggingWidget = null;
                }
            }

            if (cursorInMenu) {
                CursorHovering = true;
                return;
            }

            if (HoveredTrile != null) {
                HoveredFace = GetHoveredFace(HoveredBox, ray);
                CursorHovering = true;
            }

            if (MouseState.LeftButton.State == MouseButtonStates.Clicked) {
                bool unfocusWidget = true;

                if (HoveredTrile != null) {
                    TrileEmplacement emplacement = new TrileEmplacement(HoveredTrile.Position - HoveredFace.AsVector());
                    if (FocusedWidget is TextFieldWidget) {
                        ((TextFieldWidget) FocusedWidget).Text = emplacement.X + "; " + emplacement.Y + "; " + emplacement.Z;
                        unfocusWidget = false;
                    } else if (LevelManager.TrileSet != null && LevelManager.TrileSet.Triles.ContainsKey(TrileId)) {
                        AddTrile(CreateNewTrile(TrileId, emplacement));
                    }
                }

                if (unfocusWidget) {
                    if (FocusedWidget != null) {
                        FocusedWidget.Unfocus(gameTime);
                    }
                    FocusedWidget = null;
                }
            }

            if (MouseState.RightButton.State == MouseButtonStates.Clicked && HoveredTrile != null) {
                LevelManager.ClearTrile(HoveredTrile);
                LevelMaterializer.CullInstances();
                HoveredTrile = null;
            }

            if (MouseState.MiddleButton.State == MouseButtonStates.Clicked && HoveredTrile != null) {
                TrileId = HoveredTrile.TrileId;
            }

            CameraManager.PixelsPerTrixel = Math.Max(0.25f, CameraManager.PixelsPerTrixel + 0.25f * MouseState.WheelTurns);

            if (string.IsNullOrEmpty(TooltipWidget.Label)) {
                if (TooltipWidgetAdded) {
                    Widgets.Remove(TooltipWidget);
                    TooltipWidgetAdded = false;
                }
            } else {
                if (!TooltipWidgetAdded) {
                    Widgets.Add(TooltipWidget);
                    TooltipWidgetAdded = true;
                }
            }
        }
Beispiel #17
0
 public void FillScreenSpace(int i, int j)
 {
   Vector3 vector3 = FezMath.ForwardVector(this.CameraManager.Viewpoint);
   bool flag1 = (double) vector3.Z != 0.0;
   bool flag2 = flag1;
   int num = flag1 ? (int) vector3.Z : (int) vector3.X;
   Limit limit;
   if (!this.LevelManager.ScreenSpaceLimits.TryGetValue(new Point(i, j), out limit))
     return;
   limit.End += num;
   TrileEmplacement id = new TrileEmplacement(flag2 ? i : limit.Start, j, flag2 ? limit.Start : i);
   bool flag3 = ((flag1 ? (id.Z != limit.End ? 1 : 0) : (id.X != limit.End ? 1 : 0)) & (Math.Sign(flag1 ? limit.End - id.Z : limit.End - id.X) == num ? 1 : 0)) != 0;
   bool flag4 = true;
   for (; flag3; flag3 = flag1 ? id.Z != limit.End : id.X != limit.End)
   {
     TrileInstance instance1 = this.LevelManager.TrileInstanceAt(ref id);
     if (instance1 != null && instance1.Enabled && !instance1.Hidden && ((flag4 || instance1.PhysicsState != null) && !instance1.SkipCulling))
     {
       Point ssPos = new Point(i, j);
       this.RegisterViewedInstance(ssPos, instance1);
       this.SafeAddToBatch(instance1, false);
       flag4 = ((flag4 ? 1 : 0) & (instance1.VisualTrile.SeeThrough || id.AsVector != instance1.Position ? 1 : (instance1.ForceSeeThrough ? 1 : 0))) != 0;
       if (instance1.Overlaps)
       {
         foreach (TrileInstance instance2 in instance1.OverlappedTriles)
         {
           this.RegisterViewedInstance(ssPos, instance2);
           this.SafeAddToBatch(instance2, false);
           flag4 = ((flag4 ? 1 : 0) & (instance2.VisualTrile.SeeThrough || id.AsVector != instance2.Position ? 1 : (instance1.ForceSeeThrough ? 1 : 0))) != 0;
         }
       }
     }
     if (flag1)
       id.Z += num;
     else
       id.X += num;
   }
 }
Beispiel #18
0
 public void UpdateRow(TrileEmplacement oldEmplacement, TrileInstance instance)
 {
   if (this.rowsCleared || this.lastUpdateAction == TrileUpdateAction.SingleFaceCullFull || this.lastUpdateAction == TrileUpdateAction.SingleFaceCullPartial)
     return;
   List<TrileInstance> list;
   if (this.trileRows.TryGetValue(oldEmplacement.Y, out list))
     list.Remove(instance);
   int key = instance.Emplacement.Y;
   if (!this.trileRows.TryGetValue(key, out list))
     this.trileRows.Add(key, list = new List<TrileInstance>());
   list.Add(instance);
 }
Beispiel #19
0
 public TrileInstance(TrileEmplacement emplacement, int trileId)
   : this(emplacement.AsVector, trileId)
 {
 }