Ejemplo n.º 1
0
 private void BeginUpdate()
 {
     Operable = 0;
     anyOperablePistonStack  = null;
     hasMismatchedStacks     = false;
     hasMismatchedExtensions = false;
 }
Ejemplo n.º 2
0
 private static bool AreMatchingStacks(PistonStack a, PistonStack b)
 {
     if (a.Total != b.Total)
     {
         return(false);
     }
     if (a.BaseGrid != b.BaseGrid)
     {
         return(false);
     }
     if (a.TopGrid != b.TopGrid)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
 private void UpdateState(PistonStack pistonStack)
 {
     if (pistonStack.Operable < pistonStack.Total)
     {
         return;
     }
     Operable++;
     anyOperablePistonStack = anyOperablePistonStack ?? pistonStack;
     if (!AreMatchingStacks(anyOperablePistonStack, pistonStack))
     {
         hasMismatchedStacks = true;
     }
     if (Math.Abs(anyOperablePistonStack.Extension - pistonStack.Extension) > 0.1f)
     {
         hasMismatchedExtensions = true;
     }
 }