public BoardPost(BoardPost post) { this.postCreatorActorNum = post.postCreatorActorNum; this.postId = post.postId; this.postTitle = post.postTitle; this.postBody = post.postBody; this.comments = post.comments; }
public void ExpandPost(string bpId) { BoardPost bp = this.board.getBoardPostById(bpId); allPostsPanel.SetActive(false); expandedPostPanel.SetActive(true); expandedPost.boardPost = bp; expandedPost.Expand(); }
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); } }
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); } }
void AddPostFromRemote(BoardPost post) { this.boardPosts.Add(post); this.allPostsPage.shouldBoardBeRendered = true; notifications.NotifyPostAdded(); }