This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TypeScript lang definition file | |
# Typed variable declaration | |
(keyword,normal,symbol,normal,usertype) = `(const|let|var)([[:blank:]]*[$[:alnum:]_]+[[:blank:]]*)(:)([[:blank:]]*)([$[:alnum:]_]+)` | |
# Type annotations for function parameters | |
state symbol = "(" begin | |
state internal_object_literal delim "{" "}" begin | |
include "typescript_simple.lang" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | Sign Bit | Exponent bits | Mantissa bits | emin | emax | |
---|---|---|---|---|---|---|
binary16 | 1 | 5 | 10 | -14 | +15 | |
binary32 | 1 | 8 | 23 | -126 | +127 | |
binary64 | 1 | 11 | 52 | -1022 | +1023 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseGameSynchronizer implements ChildEventListener { | |
private DatabaseReference mMovesRecordList; | |
private Modulator mMessageModulator; | |
private int mMoveIndex; | |
private int mSelfMoveSoph; | |
private boolean mSynced; | |
private ArrayDeque<String> mUnsyncBuffer = new ArrayDeque<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseGameSynchronizer implements ChildEventListener { | |
private int mSelfMoveSoph;// Semaphore that stores the no. of moves we posted | |
private boolean mMoveIndex;// no. of moves synced currently | |
private DatabaseReference mMovesRecordList;// moves-node | |
private Modulator mMessageModulator; | |
private FirebaseGameSynchronizer(DatabaseReference movesRecordList, | |
Modulator messageModulator) { | |
mMovesRecordList = movesRecordList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseGameSynchronizer implements ChildEventListener { | |
private DatabaseReference mMovesRecordList; | |
private Modulator mMessageModulator; | |
private int mMoveIndex; | |
private int mSelfMoveSoph; | |
private boolean mSynced; | |
private ArrayDeque<String> mUnsyncBuffer = new ArrayDeque<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected class SelfChallengeCanceller implements Transaction.Handler { | |
private final SelfChallengeManager mChallenger; | |
private SelfChallengeCanceller(SelfChallengeManager challenger) { | |
Log.d("MatchMaker.Cancel", "Opened cancel request"); | |
mChallenger = challenger; | |
} | |
@NonNull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebasePlayerMatchMaker { | |
public static interface OnMatchMadeCallback { | |
public void run(FirebasePlayerMatchMaker c); | |
} | |
public static final String RANDOM_ROOM_ID = "/Globl"; | |
public static final String ROOM_ID = "/GameRooms"; | |
public static final String GAMES_RECORD = "/OpenGameMoves"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected class SelfChallengeManager implements Transaction.Handler, ValueEventListener { | |
protected final Challenge mUploadedChallenge; | |
protected DatabaseReference mChallengeRef; | |
protected DatabaseReference mGameRecordRef; | |
protected SelfChallengeManager() { | |
mUploadedChallenge = new Challenge( | |
FirebaseAuth.getInstance().getCurrentUser().getUid(), null); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected class Matcher implements Transaction.Handler { | |
private Challenge mSelectedChallenge = null; | |
private final OnFailCallback mFailCallback; | |
protected Matcher(@Nullable OnFailCallback failCallback) { | |
mFailCallback = failCallback; | |
} | |
@NonNull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.silcos.permainan.match; | |
import com.google.firebase.database.IgnoreExtraProperties; | |
@IgnoreExtraProperties | |
public class Challenge { | |
public String opener; | |
public String gameRef; |
NewerOlder