Example #1
0
 public BoardPost(BoardPost post)
 {
     this.postCreatorActorNum = post.postCreatorActorNum;
     this.postId    = post.postId;
     this.postTitle = post.postTitle;
     this.postBody  = post.postBody;
     this.comments  = post.comments;
 }
Example #2
0
        public void ExpandPost(string bpId)
        {
            BoardPost bp = this.board.getBoardPostById(bpId);

            allPostsPanel.SetActive(false);
            expandedPostPanel.SetActive(true);
            expandedPost.boardPost = bp;
            expandedPost.Expand();
        }
Example #3
0
        public void SendAddPost(BoardPost newPost)
        {
            this.boardPosts.Add(newPost); // add locally
            this.myPostsPage.shouldBoardBeRendered = true;
            notifications.NotifyPostSubmitted();

            if (PhotonNetwork.IsConnected)
            {
                this.photonView.RPC("AddPostFromRemote", RpcTarget.Others, newPost);
            }
        }
Example #4
0
        public void SubmitPost()
        {
            // Sending post to board
            BoardPost bp = new BoardPost(PhotonNetwork.LocalPlayer.ActorNumber,
                                         BoardPost.generatePostID(), this.titleInput.text, this.bodyInput.text);

            this.board.SendAddPost(bp);

            // Reducing posts left + chaging display in case 0 remaining
            this.postsRemaining--;
            this.titleInput.text         = "";
            this.bodyInput.text          = "";
            this.textPostsRemaining.text = "Posts remaining: " + postsRemaining;
            if (this.postsRemaining == 0)
            {
                newPostPanel.SetActive(false);
                submitPanel.SetActive(false);
                textNoPostsRemaining.SetActive(true);
            }
        }
Example #5
0
 void AddPostFromRemote(BoardPost post)
 {
     this.boardPosts.Add(post);
     this.allPostsPage.shouldBoardBeRendered = true;
     notifications.NotifyPostAdded();
 }