protected override void ServerInitialize(ServerInitializeData data) { base.ServerInitialize(data); if (data.IsFirstTimeInit) { // just constructed - refresh nearby door types (horizontal/vertical) DoorHelper.RefreshNeighborDoorType(data.GameObject.OccupiedTile); } SharedWallConstructionRefreshHelper.SharedRefreshNeighborObjects( data.GameObject.OccupiedTile, isDestroy: false); }
public void GetEncryptionKeyTest() { var testData = new List <Tuple <BigInteger, BigInteger, BigInteger> >() { new Tuple <BigInteger, BigInteger, BigInteger>( 17807724, 5764801, 14897079) }; foreach (var testExample in testData) { var actual = DoorHelper.GetEncryptionKey(testExample.Item1, testExample.Item2); Assert.Equal(testExample.Item3, actual); } }
public void GetLoopSizeFromPublicKeyTest() { var testData = new List <Tuple <BigInteger, int> >() { new Tuple <BigInteger, int>( 5764801, 8), new Tuple <BigInteger, int>( 17807724, 11) }; foreach (var testExample in testData) { var actual = DoorHelper.GetLoopSizeFromPublicKey(testExample.Item1); Assert.Equal(testExample.Item2, actual); } }
private static bool SharedIsCompatibleDoor( IStaticWorldObject worldObject, Tile tile, bool isConsiderConstructionSites, bool isHorizontal) { if (worldObject.ProtoWorldObject is IProtoObjectDoor && isHorizontal == worldObject.GetPublicState <ObjectDoorPublicState>().IsHorizontalDoor) { return(true); } if (isConsiderConstructionSites && ProtoObjectConstructionSite.SharedIsConstructionOf(worldObject, typeof(IProtoObjectDoor)) && isHorizontal == DoorHelper.IsHorizontalDoorNeeded(tile, checkExistingDoor: true)) { return(true); } return(false); }
private static BigInteger GetDay25Part1() { var(item1, item2) = GetDay25Input(); return(DoorHelper.GetEncryptionKey(item1, item2)); }
/// <summary> /// FindEntriesByDoor. /// </summary> /// <param name="door">Namnet på en dörr<see cref="string"/>.</param> /// <returns>En DataTable<see cref="DataTable"/> med sökresultat.</returns> public static DataTable FindEntriesByDoor(string door) { return(DoorHelper.FindEntriesByDoor(door, MaxEntries)); }