当前位置: 首页>>代码示例>>C#>>正文


C# DatabaseEntry类代码示例

本文整理汇总了C#中DatabaseEntry的典型用法代码示例。如果您正苦于以下问题:C# DatabaseEntry类的具体用法?C# DatabaseEntry怎么用?C# DatabaseEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DatabaseEntry类属于命名空间,在下文中一共展示了DatabaseEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleDidChangeRecord

    //manages if a card is dealt to the player OR if the tabletop device recalls cards
    public void HandleDidChangeRecord(string arg1, DatabaseEntry arg2, IDictionary arg3, string[] arg4)
    {
        Debug.Log ("GameObject Record Change Detected");
        //if the card is dealt to us
        if (arg2.location == clientInit.playerName) {
            GameObject newCard = Instantiate (card1, new Vector3 (0f, 4.2f, -11.0f), card1.transform.rotation) as GameObject;
            newCard.name = "PlayingCard";
            newCard.transform.Rotate (new Vector3 (0, 0, 180));				//keep the card face down
            GameObject.Find("Hand").GetComponent<HandManager>().resetShowingCards();	//reset the hand so that cards are facing down by default
            playingCard1 = newCard.GetComponent<PlayingCard> ();			//set the PlayingCard component

            //sets the variables to a local copy of the card
            playingCard1.dbEntry.location = arg2.location;
            playingCard1.dbEntry.back = arg2.back;
            playingCard1.dbEntry.number = arg2.number;
            playingCard1.dbEntry.suit = arg2.suit;
            playingCard1.dbEntry._id = arg2._id;

            //keep track of this card and enable us to manipulate it
            playingCard1.AddToRecordGroup ();

            //pick the right face of a card to show
            string cardName = arg2.back + "" + arg2.number + "" + arg2.suit;
            foreach (Transform child in newCard.transform) {
                child.gameObject.GetComponent<MeshRenderer> ().enabled = false;
                child.gameObject.SetActive (false);
                if (child.gameObject.name == cardName) {
                    child.gameObject.GetComponent<MeshRenderer> ().enabled = true;
                    child.gameObject.SetActive (true);
                }
            }

            //move the card to the appropriate location
            if (cardInPosition1) {
                newCard.GetComponent<physicalCard> ().moveToTarget (GameObject.Find ("Hand/CardLocation1"));
                cardInPosition1 = false;
            } else {
                newCard.GetComponent<physicalCard> ().moveToTarget (GameObject.Find ("Hand/CardLocation2"));
                cardInPosition1 = true;
            }

            //set the parent to "Hand" so that "Hand can easily control the cards
            newCard.transform.parent = GameObject.Find ("Hand").gameObject.transform;

            //if the tabletop device is recalling the cards (to reshuffle)
        } else if (arg2.location == "deck") {
            //moves the cards to the discard pile on mobile screen
            //and re-syncs the database that the cards are at location 'deck'
            hand.GetComponent<HandManager>().Recall();
        }
        //the card is neither being passed to us nor being recalled by the tabletop
        else {
            Debug.LogError ("this card does not belong to us, it belongs to: " + arg2.location);
            if (!production) {
                debugList.Add(arg2.location + arg2.number + arg2.suit);
                //Debug.Log ("added to list: " + arg2.location + arg2.number + arg2.suit);
                //clientInit.createMsgLog(arg2.location + "\n" + arg2.number + "\n" + arg2.suit, 1f);
            }
        }
    }
开发者ID:prizm-labs,项目名称:PokerMultiScreenDemo_HH,代码行数:61,代码来源:GameManager.cs

示例2: HandleDidChangeRecord

 public void HandleDidChangeRecord(string arg1, DatabaseEntry arg2, IDictionary arg3, string[] arg4)
 {
     Debug.Log ("record changed: " + arg2.location);
     if (arg2.location == "home") {
         cube.SetActive(true);
     }
 }
开发者ID:prizm-labs,项目名称:PrizmStarterKit_01,代码行数:7,代码来源:GameManager_TT.cs

示例3: get_key

  internal int get_key(DatabaseEntry key) {
    try {
		int ret;
		ret = libdb_csharpPINVOKE.DB_SEQUENCE_get_key(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(key)));
		DatabaseException.ThrowException(ret);
		return ret;
} finally {
      GC.KeepAlive(key);
    }
  }
开发者ID:sukantoguha,项目名称:INET-Vagrant-Demos,代码行数:10,代码来源:DB_SEQUENCE.cs

示例4: read

 internal int read(DatabaseEntry data, Int64 offset, uint size, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_STREAM_read(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(data)), offset, size, flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(data);
     }
 }
开发者ID:rohitlodha,项目名称:DenverDB,代码行数:11,代码来源:DB_STREAM.cs

示例5: send_request

 internal int send_request(IntPtr[] request, uint nrequest, DatabaseEntry response, uint timeout, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_CHANNEL_send_request(swigCPtr, request, nrequest, DBT.getCPtr(DatabaseEntry.getDBT(response)).Handle, timeout, flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(response);
     }
 }
开发者ID:mcandre,项目名称:db,代码行数:11,代码来源:DB_CHANNEL.cs

示例6: HandleDidChangeRecord

    //manages if a card is dealt to the player OR if the tabletop device recalls cards
    public void HandleDidChangeRecord(string arg1, DatabaseEntry arg2, IDictionary arg3, string[] arg4)
    {
        Debug.Log ("GameObject Record Change Detected");
        //if the card is dealt to us
        if (arg2.location == "Player") {
            Debug.Log ("record change's location is 'Player'");
            something.SetActive(true);
            something.GetComponent<ExampleObject>().dbEntry._id = arg2._id;
            Debug.Log ("setting Id to " + arg2._id + "and it worked? " + something.GetComponent<ExampleObject>().dbEntry._id );

        } else {
            Debug.LogError ("this does not belong to us, it belongs to: " + arg2.location);
        }
    }
开发者ID:prizm-labs,项目名称:PrizmStarterKit_01,代码行数:15,代码来源:GameManager_HH.cs

示例7: HandleDidAddRecord

    public void HandleDidAddRecord(string arg1, DatabaseEntry arg2)
    {
        Debug.Log ("Record added: " + arg2.location + arg2.color + arg2._id + ".");
        if (arg2.location == "home") {
            something = Instantiate (newThing, new Vector3 (0f, 10f, 0f), newThing.transform.rotation) as GameObject;
            something.name = "thing";

            exampleObject = something.GetComponent<ExampleObject> ();

            //sets the variables to a local copy of the card
            exampleObject.dbEntry.location = arg2.location;
            exampleObject.dbEntry.color = arg2.color;
            exampleObject.dbEntry._id = arg2._id;
            Debug.Log ("Make sure ID is set: " + exampleObject.dbEntry._id);

            //keep track of this card and enable us to manipulate it
            exampleObject.AddToRecordGroup ();
            something.SetActive(false);

            //if the tabletop device is recalling the cards (to reshuffle)
        } else {
            Debug.LogError ("this: " + arg2.location);
        }
    }
开发者ID:prizm-labs,项目名称:PrizmStarterKit_01,代码行数:24,代码来源:GameManager_HH.cs

示例8: key_range

 internal int key_range(DB_TXN txn, DatabaseEntry key, DB_KEY_RANGE range, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_key_range(swigCPtr, DB_TXN.getCPtr(txn), DBT.getCPtr(DatabaseEntry.getDBT(key)), DB_KEY_RANGE.getCPtr(range), flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(key);
     }
 }
开发者ID:mcandre,项目名称:db,代码行数:11,代码来源:DB.cs

示例9: log_put

 internal int log_put(DB_LSN lsn, DatabaseEntry data, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_ENV_log_put(swigCPtr, DB_LSN.getCPtr(lsn), DBT.getCPtr(DatabaseEntry.getDBT(data)), flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(data);
     }
 }
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:11,代码来源:DB_ENV.cs

示例10: lock_get

 internal DB_LOCK lock_get(uint locker, uint flags, DatabaseEntry arg2, db_lockmode_t mode)
 {
     int err = 0;
     DB_LOCK ret = lock_get(locker, flags, arg2, mode, ref err);
     DatabaseException.ThrowException(err);
     return ret;
 }
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:7,代码来源:DB_ENV.cs

示例11: rep_start

 internal int rep_start(DatabaseEntry cdata, uint flags)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_ENV_rep_start(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(cdata)), flags);
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(cdata);
     }
 }
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:11,代码来源:DB_ENV.cs

示例12: rep_process_message

 internal int rep_process_message(DatabaseEntry control, DatabaseEntry rec, int envid, DB_LSN ret_lsnp)
 {
     try {
     int ret;
     ret = libdb_csharpPINVOKE.DB_ENV_rep_process_message(swigCPtr, DBT.getCPtr(DatabaseEntry.getDBT(control)), DBT.getCPtr(DatabaseEntry.getDBT(rec)), envid, DB_LSN.getCPtr(ret_lsnp));
     DatabaseException.ThrowException(ret);
     return ret;
     } finally {
       GC.KeepAlive(control);
       GC.KeepAlive(rec);
     }
 }
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:12,代码来源:DB_ENV.cs

示例13: DBT_app_data_set

 public static extern void DBT_app_data_set(HandleRef jarg1, DatabaseEntry jarg2);
开发者ID:mcandre,项目名称:db,代码行数:1,代码来源:libdb_csharpPINVOKE.cs

示例14: IntelligentUpload

 public IntelligentUpload(CloudManagerViewModel model)
 {
     this.ViewModel = model;
     this.dbEntry = new DatabaseEntry();
 }
开发者ID:carlilord,项目名称:CloudStorageManager,代码行数:5,代码来源:IntelligentUpload.cs

示例15: Delete

        public void Delete(DatabaseEntry graphKey, Transaction transaction)
        {
            //Get all reverse index values for the internal id.
            var allKeysInIndex =
                reverseIndex
                    .GetMultiple(graphKey, (int)reverseIndex.Pagesize, transaction);

            //In the forward index, get all keys for each reverse index value and delete the record if the value matches
            //the internal id of the graph we are deleting.
            foreach (var cursor in
                from indexKey in allKeysInIndex.Value
                let c = index.Cursor(new CursorConfig(), transaction)
                where c.Move(indexKey, true)
                select c)
            {
                do
                {
                    if (cursor.Current.Value.Data.SequenceEqual(graphKey.Data)) cursor.Delete();
                }
                while (cursor.MoveNextDuplicate());

                cursor.Close();
            }

            reverseIndex.Delete(graphKey, transaction);
        }
开发者ID:AndyHitchman,项目名称:Stash,代码行数:26,代码来源:ManagedIndex.cs


注:本文中的DatabaseEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。